From 12ef2c40d9f39815c2466058c39088bc9cf6d65a Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 11 Apr 2006 07:04:55 +0000 Subject: [PATCH] Added a new field to cache "old" course_module visibility when the whole module is disabled (see bug 5021) --- lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 1 + lib/db/postgres7.php | 4 ++++ lib/db/postgres7.sql | 1 + version.php | 4 ++-- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index dd6c699516..532055779c 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -1776,6 +1776,10 @@ function main_upgrade($oldversion=0) { table_column('cache_text','formattedtext','formattedtext','longblob','','','','not null'); } + if ($oldversion < 2006041100) { + table_column('course_modules','','visibleold','integer','1','unsigned','1','not null', 'visible'); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 972aa860a9..fe04ed9828 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -159,6 +159,7 @@ CREATE TABLE `prefix_course_modules` ( `score` tinyint(4) NOT NULL default '0', `indent` int(5) unsigned NOT NULL default '0', `visible` tinyint(1) NOT NULL default '1', + `visibleold` tinyint(1) NOT NULL default '1', `groupmode` tinyint(4) NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 81230be653..713e0ece65 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -1488,6 +1488,10 @@ function main_upgrade($oldversion=0) { execute_sql(" CREATE INDEX {$CFG->prefix}course_sections_coursesection_idx ON {$CFG->prefix}course_sections (course,section) ", false); } + if ($oldversion < 2006041100) { + table_column('course_modules','','visibleold','integer','1','unsigned','1','not null', 'visible'); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index a413aedae6..ca5ea44a2e 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -104,6 +104,7 @@ CREATE TABLE prefix_course_modules ( score integer NOT NULL default '0', indent integer NOT NULL default '0', visible integer NOT NULL default '1', + visibleold integer NOT NULL default '1', groupmode integer NOT NULL default '0' ); diff --git a/version.php b/version.php index f2f63a06a1..b998ece6c9 100644 --- a/version.php +++ b/version.php @@ -6,9 +6,9 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2006041001; // YYYYMMDD = date + $version = 2006041100; // YYYYMMDD = date // XY = increments within a single day - $release = '1.6 Beta 2'; // Human-friendly version name + $release = '1.6 Beta 3'; // Human-friendly version name ?> -- 2.39.5