Merge "Clean up ar_usertext_timestamp index mess"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Sep 2019 19:41:56 +0000 (19:41 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Sep 2019 19:41:56 +0000 (19:41 +0000)
includes/db/MWLBFactory.php
includes/installer/MysqlUpdater.php
maintenance/archives/patch-drop-archive-ar_usertext_timestamp.sql [new file with mode: 0644]
maintenance/archives/patch-drop-archive-usertext_timestamp.sql [new file with mode: 0644]
maintenance/archives/patch-drop-user-fields.sql

index 1803009..ad5708a 100644 (file)
@@ -381,7 +381,6 @@ abstract class MWLBFactory {
                         * T154872).
                         */
                        $lbFactory->setIndexAliases( [
-                               'ar_usertext_timestamp' => 'usertext_timestamp',
                                'un_user_id' => 'user_id',
                                'un_user_ip' => 'user_ip',
                        ] );
index ea88411..7d41d04 100644 (file)
@@ -386,6 +386,9 @@ class MysqlUpdater extends DatabaseUpdater {
                        [ 'modifyTable', 'job', 'patch-job-params-mediumblob.sql' ],
 
                        // 1.34
+                       [ 'dropIndex', 'archive', 'ar_usertext_timestamp',
+                               'patch-drop-archive-ar_usertext_timestamp.sql' ],
+                       [ 'dropIndex', 'archive', 'usertext_timestamp', 'patch-drop-archive-usertext_timestamp.sql' ],
                        [ 'dropField', 'logging', 'log_user', 'patch-drop-user-fields.sql' ],
                ];
        }
diff --git a/maintenance/archives/patch-drop-archive-ar_usertext_timestamp.sql b/maintenance/archives/patch-drop-archive-ar_usertext_timestamp.sql
new file mode 100644 (file)
index 0000000..158d9ae
--- /dev/null
@@ -0,0 +1,7 @@
+-- T233221: The index on `archive` variously known as `ar_usertext_timestamp`
+-- and `usertext_timestamp` has a long and sordid history. We're dropping the
+-- `ar_user_text` column entirely now (see patch-drop-user-fields.sql), but
+-- this index needs special care thanks to said history.
+
+-- Do not use the /*i*/ thing here!
+DROP INDEX ar_usertext_timestamp ON /*_*/archive;
diff --git a/maintenance/archives/patch-drop-archive-usertext_timestamp.sql b/maintenance/archives/patch-drop-archive-usertext_timestamp.sql
new file mode 100644 (file)
index 0000000..f409e97
--- /dev/null
@@ -0,0 +1,7 @@
+-- T233221: The index on `archive` variously known as `ar_usertext_timestamp`
+-- and `usertext_timestamp` has a long and sordid history. We're dropping the
+-- `ar_user_text` column entirely now (see patch-drop-user-fields.sql), but
+-- this index needs special care thanks to said history.
+
+-- Do not use the /*i*/ thing here!
+DROP INDEX usertext_timestamp ON /*_*/archive;
index 7faa593..1d0b057 100644 (file)
@@ -4,7 +4,6 @@
 -- T188327. Drop old xx_user and xx_user_text fields, and defaults from xx_actor fields.
 
 ALTER TABLE /*_*/archive
-  DROP INDEX /*i*/ar_usertext_timestamp,
   DROP COLUMN ar_user,
   DROP COLUMN ar_user_text,
   ALTER COLUMN ar_actor DROP DEFAULT;