From 925c5efd3e624c422f5d2c3ad89778c8b5255cf0 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 21 Aug 2011 17:43:34 +0200 Subject: [PATCH] MDL-29031 drop unused block tables --- lib/adminlib.php | 2 +- lib/db/install.xml | 45 +++------------------------------------------ lib/db/upgrade.php | 16 +++++++++++++--- version.php | 2 +- 4 files changed, 18 insertions(+), 47 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index cf21bcf898a..3102853ecff 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -6259,7 +6259,7 @@ function db_replace($search, $replace) { // TODO: this is horrible hack, we should do whitelisting and each plugin should be responsible for proper replacing... $skiptables = array('config', 'config_plugins', 'config_log', 'upgrade_log', 'filter_config', 'sessions', 'events_queue', 'repository_instance_config', - 'block_instances', 'block_pinned_old', 'block_instance_old', ''); + 'block_instances', ''); // Turn off time limits, sometimes upgrades can be slow. @set_time_limit(0); diff --git a/lib/db/install.xml b/lib/db/install.xml index 407c6f918d6..f72b59bc534 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -2479,7 +2479,7 @@ - +
@@ -2499,46 +2499,7 @@
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index fe226911a47..742faa8d830 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -6662,12 +6662,22 @@ FROM upgrade_main_savepoint(true, 2011081700.01); } + if ($oldversion < 2011081700.02) { + // remove safety block backup from 2.0 upgrade + $table = new xmldb_table('block_pinned_old'); + if ($dbman->table_exists($table)) { + $dbman->drop_table($table); + } + $table = new xmldb_table('block_instance_old'); + if ($dbman->table_exists($table)) { + $dbman->drop_table($table); + } + upgrade_main_savepoint(true, 2011081700.02); + } + return true; } -//TODO: Cleanup before the 2.0 release - we do not want to drag along these dev machine fixes forever -// 1/ drop block_pinned_old table here and in install.xml -// 2/ drop block_instance_old table here and in install.xml //TODO: AFTER 2.0 remove the column user->emailstop and the user preference "message_showmessagewindow" diff --git a/version.php b/version.php index 1b2578a8bfd..101f4eeacdb 100644 --- a/version.php +++ b/version.php @@ -31,7 +31,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2011081700.01; // YYYYMMDD = weekly release date of this DEV branch +$version = 2011081700.02; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes -- 2.17.1