/[drupal]/contributions/modules/gradebook/gradebookapi.install
ViewVC logotype

Contents of /contributions/modules/gradebook/gradebookapi.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Sat Apr 7 05:25:53 2007 UTC (2 years, 7 months ago) by rwohleb
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.1: +3 -3 lines
File MIME type: text/x-php
* Initial support for Drupal 5
* Fixed 'default' SQL bug in text/blob field for MySQL
1 <?php
2 // $Id: gradebookapi.install,v 1.1 2006/11/05 23:36:09 rwohleb Exp $
3
4 function gradebookapi_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysql':
7 case 'mysqli':
8 // the {tablename} syntax is so multisite installs can add a
9 // prefix to the table name as set in the settings.php file
10 db_query("CREATE TABLE {gradebookapi_assignment} (
11 nid int(10) unsigned NOT NULL,
12 possible int(10) NOT NULL default '0',
13 PRIMARY KEY (nid)
14 )");
15 db_query("CREATE TABLE {gradebookapi_grade} (
16 uid int(10) unsigned NOT NULL,
17 nid int(10) unsigned NOT NULL,
18 earned int(10) NOT NULL default '0',
19 exempt int(2) NOT NULL default '0',
20 timestamp int(11) NOT NULL default '0',
21 note longtext NULL,
22 PRIMARY KEY (uid, nid)
23 )");
24 db_query("CREATE TABLE {gradebookapi_cache} (
25 uid int(10) unsigned NOT NULL,
26 tid int(10) unsigned NOT NULL,
27 earned int(10) NOT NULL default '0',
28 possible int(10) NOT NULL default '0',
29 PRIMARY KEY (uid, tid)
30 )");
31 break;
32 case 'pgsql':
33 db_query("CREATE TABLE \"gradebookapi_assignment\" (
34 \"nid\" int(10) unsigned NOT NULL default '0',
35 \"possible\" int(10) NOT NULL default '0',
36 PRIMARY KEY (\"nid\")
37 )");
38 db_query("CREATE TABLE \"gradebookapi_grade\" (
39 \"uid\" int(10) unsigned NOT NULL default '0',
40 \"nid\" int(10) unsigned NOT NULL default '0',
41 \"earned\" int(10) NOT NULL default '0',
42 \"exempt\" int(2) NOT NULL default '0',
43 \"timestamp\" int(11) NOT NULL default '0',
44 \"note\" longtext NULL,
45 PRIMARY KEY (\"uid\",\"nid\")
46 )");
47 db_query("CREATE TABLE \"gradebookapi_cache\" (
48 \"uid\" int(10) unsigned NOT NULL default '0',
49 \"tid\" int(10) unsigned NOT NULL default '0',
50 \"earned\" int(10) NOT NULL default '0',
51 \"possible\" int(10) NOT NULL default '0',
52 PRIMARY KEY (\"uid\",\"tid\")
53 )");
54 break;
55 }
56 }

  ViewVC Help
Powered by ViewVC 1.1.2