Permalink
Browse files

Corrected typo in mysql.sql

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.
  • Loading branch information...
1 parent 4300405 commit 5b9ce58cdc554b5f726b874f7e0fa9fd8e042cb1 paca70 committed Nov 2, 2004
Showing with 17 additions and 1 deletion.
  1. +1 −1 mod/lesson/db/mysql.sql
  2. +13 −0 mod/lesson/db/postgres7.php
  3. +3 −0 mod/lesson/db/postgres7.sql
View
@@ -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`)
@@ -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;
}
@@ -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',

0 comments on commit 5b9ce58

Please sign in to comment.