From 99215f2c6fac6e5f266830de3d212ee7568ab5e5 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 31 Aug 2006 19:39:18 +0000 Subject: [PATCH] modinfo nullable and without default. --- lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 2 +- lib/db/postgres7.php | 5 +++++ lib/db/postgres7.sql | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index cef6b38320..6463fd411c 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -2169,6 +2169,10 @@ function main_upgrade($oldversion=0) { table_column('capabilities', '', 'riskbitmask', 'INTEGER', '10', 'unsigned', '0', 'not null', ''); } + if ($oldversion < 2006083100) { + execute_sql("ALTER TABLE {$CFG->prefix}course CHANGE modinfo modinfo longtext NULL AFTER showgrades"); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 8d9a8b449c..bea4385149 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -53,7 +53,7 @@ CREATE TABLE `prefix_course` ( `summary` text NOT NULL default '', `format` varchar(10) NOT NULL default 'topics', `showgrades` smallint(2) unsigned NOT NULL default '1', - `modinfo` longtext NOT NULL default '', + `modinfo` longtext, `newsitems` smallint(5) unsigned NOT NULL default '1', `teacher` varchar(100) NOT NULL default 'Teacher', `teachers` varchar(100) NOT NULL default 'Teachers', diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index aefb67cd62..8796ba1a30 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -1764,6 +1764,11 @@ function main_upgrade($oldversion=0) { table_column('capabilities', '', 'riskbitmask', 'INTEGER', '10', 'unsigned', '0', 'not null', ''); } + if ($oldversion < 2006083100) { + execute_sql("ALTER TABLE {$CFG->prefix}course ALTER COLUMN modinfo DROP NOT NULL"); + execute_sql("ALTER TABLE {$CFG->prefix}course ALTER COLUMN modinfo DROP DEFAULT"); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index deabce829a..a9293b9a1a 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -24,7 +24,7 @@ CREATE TABLE prefix_course ( summary text NOT NULL default '', format varchar(10) NOT NULL default 'topics', showgrades integer NOT NULL default '1', - modinfo text NOT NULL default '', + modinfo text, newsitems integer NOT NULL default '1', teacher varchar(100) NOT NULL default 'Teacher', teachers varchar(100) NOT NULL default 'Teachers', -- 2.39.5