From eeccaea183f77b5cd56ce4cee9439de76fe53198 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 10 Oct 2007 07:53:35 +0000 Subject: [PATCH] MDL-11686 dropped obsoleted grade tables, removed context_rel related upgrade code --- lib/db/install.xml | 84 ++-------------------------------------------- lib/db/upgrade.php | 47 +++++--------------------- version.php | 2 +- 3 files changed, 12 insertions(+), 121 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 56f5c0060f..ddb0d817db 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -253,7 +253,7 @@ - +
@@ -268,85 +268,7 @@
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index b2332b450d..a31e18652d 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -504,30 +504,6 @@ function xmldb_main_upgrade($oldversion=0) { } } - if ($result && $oldversion < 2007011200) { - - /// Define table context_rel to be created - $table = new XMLDBTable('context_rel'); - - /// Adding fields to table context_rel - $table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null); - $table->addFieldInfo('c1', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); - $table->addFieldInfo('c2', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null); - - /// Adding keys to table context_rel - $table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->addKeyInfo('c1', XMLDB_KEY_FOREIGN, array('c1'), 'context', array('id')); - $table->addKeyInfo('c2', XMLDB_KEY_FOREIGN, array('c2'), 'context', array('id')); - $table->addKeyInfo('c1c2', XMLDB_KEY_UNIQUE, array('c1', 'c2')); - - /// Launch create table for context_rel - $result = $result && create_table($table); - - /// code here to fill the context_rel table - /// use get record set to iterate slower - /// /deprecated and gone / build_context_rel(); - } - if ($result && $oldversion < 2007011501) { if (!empty($CFG->enablerecordcache) && empty($CFG->rcache) && // Note: won't force-load these settings into CFG @@ -1475,12 +1451,6 @@ function xmldb_main_upgrade($oldversion=0) { /// originally there was supportname and supportemail upgrade code - this is handled in upgradesettings.php instead - /// MDL-10679, context_rel clean up - if ($result && $oldversion < 2007080200) { - delete_records('context_rel'); - /// /deprecated and gone / build_context_rel(); - } - if ($result && $oldversion < 2007080202) { /// Define index tagiditem (not unique) to be dropped form tag_instance @@ -2394,14 +2364,16 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && create_table($table); } - // dropping context_rel table +/// dropping context_rel table - not used anymore if ($result && $oldversion < 2007100800) { /// Define table context_rel to be dropped $table = new XMLDBTable('context_rel'); /// Launch drop table for context_rel - $result = $result && drop_table($table); + if (table_exists($table)) { + drop_table($table); + } } /// Truncate the text_cahe table and add new index @@ -2429,12 +2401,8 @@ function xmldb_main_upgrade($oldversion=0) { execute_sql($sql); } - - - -/* NOTE: please keep this at the end of upgrade file for now ;-) - /// drop old gradebook tables - if ($result && $oldversion < xxxxxxxx) { +/// drop old gradebook tables + if ($result && $oldversion < 2007100903) { $tables = array('grade_category', 'grade_item', 'grade_letter', @@ -2448,7 +2416,8 @@ function xmldb_main_upgrade($oldversion=0) { } } } -*/ + + return $result; } diff --git a/version.php b/version.php index 5828ef5131..8acaa2913a 100644 --- a/version.php +++ b/version.php @@ -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 = 2007100902; // YYYYMMDD = date + $version = 2007100903; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 Beta +'; // Human-friendly version name -- 2.39.5