Merge "Convert HTTP links to MediaWiki.org to HTTPS"
[lhc/web/wiklou.git] / includes / installer / PostgresUpdater.php
index 48f47f5..ba00dec 100644 (file)
@@ -294,7 +294,7 @@ class PostgresUpdater extends DatabaseUpdater {
                                [ 'log_timestamp', 'timestamptz_ops', 'btree', 0 ],
                        ],
                        'CREATE INDEX "logging_times" ON "logging" USING "btree" ("log_timestamp")' ],
-                       [ 'dropIndex', 'oldimage', 'oi_name' ],
+                       [ 'dropPgIndex', 'oldimage', 'oi_name' ],
                        [ 'checkIndex', 'oi_name_archive_name', [
                                [ 'oi_name', 'text_ops', 'btree', 0 ],
                                [ 'oi_archive_name', 'text_ops', 'btree', 0 ],
@@ -353,7 +353,7 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'checkOiNameConstraint' ],
                        [ 'checkPageDeletedTrigger' ],
                        [ 'checkRevUserFkey' ],
-                       [ 'dropIndex', 'ipblocks', 'ipb_address' ],
+                       [ 'dropPgIndex', 'ipblocks', 'ipb_address' ],
                        [ 'checkIndex', 'ipb_address_unique', [
                                [ 'ipb_address', 'text_ops', 'btree', 0 ],
                                [ 'ipb_user', 'int4_ops', 'btree', 0 ],
@@ -481,6 +481,10 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'changeNullableField', 'protected_titles', 'pt_reason', 'NOT NULL', true ],
                        [ 'addPgField', 'protected_titles', 'pt_reason_id', 'INTEGER NOT NULL DEFAULT 0' ],
                        [ 'addTable', 'comment', 'patch-comment-table.sql' ],
+
+                       // This field was added in 1.31, but is put here so it can be used by 'migrateComments'
+                       [ 'addPgField', 'image', 'img_description_id', 'INTEGER NOT NULL DEFAULT 0' ],
+
                        [ 'migrateComments' ],
                        [ 'addIndex', 'site_stats', 'site_stats_pkey', 'patch-site_stats-pk.sql' ],
                        [ 'addTable', 'ip_changes', 'patch-ip_changes.sql' ],
@@ -533,6 +537,14 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'addPgIndex', 'logging', 'logging_actor_type_time', '( log_actor, log_type, log_timestamp )' ],
                        [ 'addPgIndex', 'logging', 'logging_actor_time', '( log_actor, log_timestamp )' ],
                        [ 'migrateActors' ],
+                       [ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ],
+                       [ 'populateArchiveRevId' ],
+                       [ 'dropPgIndex', 'recentchanges', 'rc_namespace_title' ],
+                       [
+                               'addPgIndex',
+                               'recentchanges',
+                               'rc_namespace_title_timestamp', '( rc_namespace, rc_title, rc_timestamp )'
+                       ],
                ];
        }
 
@@ -1060,7 +1072,7 @@ END;
                }
        }
 
-       protected function dropIndex( $table, $index, $patch = '', $fullpath = false ) {
+       protected function dropPgIndex( $table, $index ) {
                if ( $this->db->indexExists( $table, $index ) ) {
                        $this->output( "Dropping obsolete index '$index'\n" );
                        $this->db->query( "DROP INDEX \"" . $index . "\"" );