]> git.mjollnir.org Git - moodle.git/commitdiff
Corrected typo in mysql.sql
authorpaca70 <paca70>
Tue, 2 Nov 2004 08:51:24 +0000 (08:51 +0000)
committerpaca70 <paca70>
Tue, 2 Nov 2004 08:51:24 +0000 (08:51 +0000)
Added support for postgresql.
BTW is it posible to use table_column() function also with mysql, that would make
mysql-code easily portable to other database-files.

mod/lesson/db/mysql.sql
mod/lesson/db/postgres7.php
mod/lesson/db/postgres7.sql

index e8f69317ea999893908f7665720d1e2b4e406f96..ddb39659facbcd822fd389737b5204aa9a8b52fa 100644 (file)
@@ -82,7 +82,7 @@ CREATE TABLE `prefix_lesson_attempts` (
   `answerid` int(10) unsigned NOT NULL default '0',
   `retry` int(3) unsigned NOT NULL default '0',
   `correct` int(10) unsigned NOT NULL default '0',
-  `useranswer' text NOT NULL default '',
+  `useranswer` text NOT NULL default '',
   `timeseen` int(10) unsigned NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY (`userid`)
index 7cec72e717cae59a5ae57c88024decb6e4a8f59e..57df935ed85adf10918c130cbf8367786d6dec95 100644 (file)
@@ -175,7 +175,20 @@ function lesson_upgrade($oldversion) {
                )");
        }
        // CDC-FLAG end 
+    if ($oldversion < 2004100400) {
+               //execute_sql(" ALTER TABLE `{$CFG->prefix}lesson_attempts` ADD `useranswer` text NOT NULL AFTER correct");
+        table_column('lesson_attempts', '', 'useranswer', 'text', '', '', '', 'NOT NULL', 'correct');
+       }
+       
+       if ($oldversion < 2004100700) {
+               //execute_sql(" ALTER TABLE `{$CFG->prefix}lesson` ADD `modattempts` tinyint(3) unsigned NOT NULL default '0' AFTER practice");
+        table_column('lesson', '', 'modattempts', 'INT', '4', 'unsigned', '0', 'NOT NULL', 'practice');
+       }
 
+       if ($oldversion < 2004102600) {
+               //execute_sql(" ALTER TABLE `{$CFG->prefix}lesson_default` ADD `modattempts` tinyint(3) unsigned NOT NULL default '0' AFTER practice");
+        table_column('lesson_default', '', 'modattempts', 'INT', '4', 'unsigned', '0', 'NOT NULL', 'practice');
+       }
     
     return true;
 }
index f4cb24e5254a25460dcbee260aa91f11ee18f723..e6959cd3dd9bb62cc87c4ed79129950c165be9c6 100644 (file)
@@ -3,6 +3,7 @@ CREATE TABLE prefix_lesson (
   course INT8  NOT NULL default '0',
   name varchar(255) NOT NULL default '',
   practice INT  NOT NULL DEFAULT '0',
+  modattempts INT4 NOT NULL DEFAULT '0',
   usepassword INT  NOT NULL DEFAULT '0',
   password VARCHAR(32) NOT NULL default '',
   grade INT NOT NULL default '0',
@@ -69,6 +70,7 @@ CREATE TABLE prefix_lesson_attempts (
   answerid INT8  NOT NULL default '0',
   retry INT  NOT NULL default '0',
   correct INT8  NOT NULL default '0',
+  useranswer text NOT NULL default '',
   timeseen INT8  NOT NULL default '0'
 ) ;
 CREATE INDEX prefix_lesson_attempts_userid_idx ON prefix_lesson_attempts (userid);
@@ -86,6 +88,7 @@ CREATE TABLE prefix_lesson_default
                ( id SERIAL8 PRIMARY KEY,
                  course INT8  NOT NULL default '0',
                  practice INT  NOT NULL default '0',
+                 modattempts INT4 NOT NULL default '0',
                  password varchar(32) NOT NULL default '',
                  usepassword INT  NOT NULL default '0',
                  grade INT NOT NULL default '0',