Skip to content

Commit

Permalink
Remove "deleted" field from course_modules table
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Mar 31, 2005
1 parent 90d0ae4 commit 594ceed
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lib/db/mysql.php
Expand Up @@ -1312,6 +1312,12 @@ function main_upgrade($oldversion=0) {

}

if ($oldversion < 2005033100) { // Get rid of defunct field from course modules table
delete_records('course_modules', 'deleted', 1); // Delete old records we don't need any more
execute_sql('ALTER TABLE `'.$CFG->prefix.'course_modules` DROP INDEX `deleted`'); // Old index
execute_sql('ALTER TABLE `'.$CFG->prefix.'course_modules` DROP `deleted`'); // Old field
}

return $result;
}

Expand Down
4 changes: 1 addition & 3 deletions lib/db/mysql.sql
Expand Up @@ -129,7 +129,6 @@ CREATE TABLE `prefix_course_modules` (
`instance` int(10) unsigned NOT NULL default '0',
`section` int(10) unsigned NOT NULL default '0',
`added` int(10) unsigned NOT NULL default '0',
`deleted` tinyint(1) unsigned NOT NULL default '0',
`score` tinyint(4) NOT NULL default '0',
`indent` int(5) unsigned NOT NULL default '0',
`visible` tinyint(1) NOT NULL default '1',
Expand All @@ -139,8 +138,7 @@ CREATE TABLE `prefix_course_modules` (
KEY `visible` (`visible`),
KEY `course` (`course`),
KEY `module` (`module`),
KEY `instance` (`instance`),
KEY `deleted` (`deleted`)
KEY `instance` (`instance`)
) TYPE=MyISAM;
# --------------------------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions lib/db/postgres7.php
Expand Up @@ -1028,6 +1028,12 @@ function main_upgrade($oldversion=0) {
modify_database('',"CREATE UNIQUE INDEX prefix_grade_prefs_courseidpref_uk ON prefix_grade_preferences (courseid,preference);");
}

if ($oldversion < 2005033100) { // Get rid of defunct field from course modules table
delete_records('course_modules', 'deleted', 1); // Delete old records we don't need any more
execute_sql('DROP INDEX '.$CFG->prefix.'prefix_course_modules_deleted_idx;'); // Old index
execute_sql('ALTER TABLE '.$CFG->prefix.'course_modules DROP `deleted`;'); // Old field
}

return $result;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/db/postgres7.sql
Expand Up @@ -81,7 +81,6 @@ CREATE TABLE prefix_course_modules (
instance integer NOT NULL default '0',
section integer NOT NULL default '0',
added integer NOT NULL default '0',
deleted integer NOT NULL default '0',
score integer NOT NULL default '0',
indent integer NOT NULL default '0',
visible integer NOT NULL default '1',
Expand All @@ -92,7 +91,6 @@ CREATE INDEX prefix_course_modules_visible_idx ON prefix_course_modules (visible
CREATE INDEX prefix_course_modules_course_idx ON prefix_course_modules (course);
CREATE INDEX prefix_course_modules_module_idx ON prefix_course_modules (module);
CREATE INDEX prefix_course_modules_instance_idx ON prefix_course_modules (instance);
CREATE INDEX prefix_course_modules_deleted_idx ON prefix_course_modules (deleted);

CREATE TABLE prefix_course_sections (
id SERIAL PRIMARY KEY,
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2005032800; // YYYYMMDD = date
$version = 2005033100; // YYYYMMDD = date
// XY = increments within a single day

$release = '1.5 UNSTABLE DEVELOPMENT'; // Human-friendly version name
Expand Down

0 comments on commit 594ceed

Please sign in to comment.