Merge "Add MessagesBi.php"
[lhc/web/wiklou.git] / includes / installer / PostgresUpdater.php
index 49419ea..8fd5370 100644 (file)
@@ -582,6 +582,21 @@ class PostgresUpdater extends DatabaseUpdater {
                                'change_tag_tag_id_id',
                                '( ct_tag_id, ct_rc_id, ct_rev_id, ct_log_id )'
                        ],
+                       [ 'addPgIndex', 'archive', 'ar_revid_uniq', '(ar_rev_id)', 'unique' ],
+                       [ 'dropPgIndex', 'archive', 'ar_revid' ], // Probably doesn't exist, but do it anyway.
+                       [ 'populateContentTables' ],
+                       [ 'addPgIndex', 'logging', 'log_type_action', '( log_type, log_action, log_timestamp )' ],
+                       [ 'dropPgIndex', 'page_props', 'page_props_propname' ],
+                       [ 'addIndex', 'interwiki', 'interwiki_pkey', 'patch-interwiki-pk.sql' ],
+                       [ 'addIndex', 'protected_titles', 'protected_titles_pkey', 'patch-protected_titles-pk.sql' ],
+                       [ 'addIndex', 'site_identifiers', 'site_identifiers_pkey', 'patch-site_identifiers-pk.sql' ],
+                       [ 'addPgIndex', 'recentchanges', 'rc_this_oldid', '(rc_this_oldid)' ],
+                       [ 'dropTable', 'transcache' ],
+                       [ 'runMaintenance', PopulateChangeTagDef::class, 'maintenance/populateChangeTagDef.php' ],
+                       [ 'addIndex', 'change_tag', 'change_tag_rc_tag_id',
+                               'patch-change_tag-change_tag_rc_tag_id.sql' ],
+                       [ 'addPgField', 'ipblocks', 'ipb_sitewide', 'SMALLINT NOT NULL DEFAULT 1' ],
+                       [ 'addTable', 'ipblocks_restrictions', 'patch-ipblocks_restrictions-table.sql' ],
                ];
        }
 
@@ -959,12 +974,13 @@ END;
                }
        }
 
-       public function addPgIndex( $table, $index, $type ) {
+       public function addPgIndex( $table, $index, $type, $unique = false ) {
                if ( $this->db->indexExists( $table, $index ) ) {
                        $this->output( "...index '$index' on table '$table' already exists\n" );
                } else {
                        $this->output( "Creating index '$index' on table '$table' $type\n" );
-                       $this->db->query( "CREATE INDEX $index ON $table $type" );
+                       $unique = $unique ? 'UNIQUE' : '';
+                       $this->db->query( "CREATE $unique INDEX $index ON $table $type" );
                }
        }