Add missing fields when upgrading/installing on Postgres

mod/exercise, mod/scorm and question/type/rqp
MDL-12023
This commit is contained in:
fmarier
2007-11-09 01:21:14 +00:00
parent 1b09c97190
commit c313ffa5db
7 changed files with 32 additions and 7 deletions
+4 -4
View File
@@ -6,10 +6,6 @@ function exercise_upgrade($oldversion) {
global $CFG;
if ($oldversion < 2003121000) {
execute_sql(" ALTER TABLE `{$CFG->prefix}exercise_submissions` ADD `late` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
}
if ($oldversion < 2004062300) {
table_column("exercise", "", "gradinggrade", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "grade");
table_column("exercise", "", "assessmentcomps", "INTEGER", "4", "UNSIGNED", "2", "NOT NULL", "usemaximum");
@@ -44,6 +40,10 @@ function exercise_upgrade($oldversion) {
modify_database('','CREATE INDEX prefix_exercise_grades_exerciseid_idx ON prefix_exercise_grades (exerciseid);');
}
if ($oldversion < 2006080702) {
table_column("exercise_submissions", "", "late", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
}
return true;
}
+2 -1
View File
@@ -39,7 +39,8 @@ CREATE TABLE prefix_exercise_submissions (
timecreated INT8 NOT NULL default '0',
resubmit INT NOT NULL default '0',
mailed INT NOT NULL default '0',
isexercise INT NOT NULL default '0'
isexercise INT NOT NULL default '0',
late INT4 NOT NULL default '0'
);
CREATE INDEX prefix_exercise_submissions_userid_idx ON prefix_exercise_submissions (userid);
CREATE INDEX prefix_exercise_submissions_exerciseid_idx ON prefix_exercise_submissions (exerciseid);
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080701; // change only last two digits in 1.6.x!!
$module->version = 2006080702; // change only last two digits in 1.6.x!!
$module->requires = 2006050512; // Requires this Moodle version
$module->cron = 60;
+1
View File
@@ -7,6 +7,7 @@ CREATE TABLE prefix_scorm (
course integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
reference varchar(255) NOT NULL default '',
version varchar(9) NOT NULL default '',
maxgrade real NOT NULL default '0',
grademethod integer NOT NULL default '0',
maxattempt integer NOT NULL default '1',
+10
View File
@@ -5,6 +5,16 @@
function qtype_rqp_upgrade($oldversion=0) {
global $CFG;
if ($oldversion < 2006032201) {
modify_database('','CREATE TABLE prefix_question_rqp_servers (
id SERIAL PRIMARY KEY,
typeid integer NOT NULL default 0,
url varchar(255) NOT NULL default \'\',
can_render INT4 NOT NULL default 0,
can_author INT4 NOT NULL default 0
);');
}
return true;
}
+13
View File
@@ -17,6 +17,19 @@ CREATE TABLE prefix_question_rqp (
CREATE INDEX prefix_question_rqp_question_idx ON prefix_question_rqp (question);
# --------------------------------------------------------
#
# Table structure for table prefix_question_rqp_servers
#
CREATE TABLE prefix_question_rqp_servers (
id SERIAL PRIMARY KEY,
typeid integer NOT NULL default '0',
url varchar(255) NOT NULL default '',
can_render INT4 NOT NULL default '0',
can_author INT4 NOT NULL default '0'
);
# --------------------------------------------------------
+1 -1
View File
@@ -1,6 +1,6 @@
<?PHP // $Id$
$plugin->version = 2006032200;
$plugin->version = 2006032201;
$plugin->requires = 2006032200;
?>