From: Sam Reed Date: Tue, 10 Jan 2012 15:04:05 +0000 (+0000) Subject: Cleanup "text" (nee old) table, dropping old indexes and fields X-Git-Tag: 1.31.0-rc.0~25370 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=cc8a1f1106b33c6a969d4936611ba6b2224f790a;p=lhc%2Fweb%2Fwiklou.git Cleanup "text" (nee old) table, dropping old indexes and fields Add oldwatchlist to dropAncientTables --- diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index e92e31c8b1..d77940eb40 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -193,6 +193,7 @@ class MysqlUpdater extends DatabaseUpdater { array( 'addField', 'uploadstash', 'us_chunk_inx', 'patch-uploadstash_chunk.sql' ), array( 'addfield', 'job', 'job_timestamp', 'patch-jobs-add-timestamp.sql' ), array( 'dropAncientTables' ), + array( 'cleanupTextTable' ), ); } @@ -864,6 +865,7 @@ class MysqlUpdater extends DatabaseUpdater { 'links', // 1.4 'linkscc', // 1.4 'old', // 1.4 + 'oldwatchlist', // pre 1.1? 'trackback', // 1.19 'user_rights', // 1.5 'validate', // 1.6 @@ -875,4 +877,30 @@ class MysqlUpdater extends DatabaseUpdater { } } } + + protected function cleanupTextTable() { + $this->output( "Cleaning up text table\n" ); + + /*$oldIndexes = array( + 'old_namespace', + 'old_timestamp', + 'name_title_timestamp', + 'user_timestamp', + 'usertext_timestamp', + );*/ + $this->dropIndex( 'text', 'old_namespace', 'patch-drop_old_text_indexes.sql' ); + + /*$oldFields = array( + 'old_namespace', + 'old_title', + 'old_comment', + 'old_user', + 'old_user_text', + 'old_timestamp', + 'old_minor_edit', + 'inverse_timestamp', + );*/ + $this->dropField( 'text', 'old_namespace', 'patch-drop_old_text_fields.sql' ); + } + } diff --git a/maintenance/archives/patch-drop_old_text_fields.sql b/maintenance/archives/patch-drop_old_text_fields.sql new file mode 100644 index 0000000000..9fe6394b18 --- /dev/null +++ b/maintenance/archives/patch-drop_old_text_fields.sql @@ -0,0 +1,8 @@ +ALTER TABLE /*_*/text DROP COLUMN old_namespace; +ALTER TABLE /*_*/text DROP COLUMN old_title; +ALTER TABLE /*_*/text DROP COLUMN old_comment; +ALTER TABLE /*_*/text DROP COLUMN old_user; +ALTER TABLE /*_*/text DROP COLUMN old_user_text; +ALTER TABLE /*_*/text DROP COLUMN old_timestamp; +ALTER TABLE /*_*/text DROP COLUMN old_minor_edit; +ALTER TABLE /*_*/text DROP COLUMN inverse_timestamp; \ No newline at end of file diff --git a/maintenance/archives/patch-drop_old_text_indexes.sql b/maintenance/archives/patch-drop_old_text_indexes.sql new file mode 100644 index 0000000000..a35839922c --- /dev/null +++ b/maintenance/archives/patch-drop_old_text_indexes.sql @@ -0,0 +1,5 @@ +DROP INDEX old_namespace ON /*_*/text; +DROP INDEX old_timestamp ON /*_*/text; +DROP INDEX name_title_timestamp ON /*_*/text; +DROP INDEX user_timestamp ON /*_*/text; +DROP INDEX usertext_timestamp ON /*_*/text; \ No newline at end of file