Merge "resourceloader: Make various CSSMin performance optimizations and cleanups"
[lhc/web/wiklou.git] / includes / installer / PostgresUpdater.php
index 5026ae9..6263edb 100644 (file)
@@ -569,6 +569,12 @@ class PostgresUpdater extends DatabaseUpdater {
                        [ 'setSequenceOwner', 'change_tag', 'ct_id', 'change_tag_ct_id_seq' ],
                        [ 'setSequenceOwner', 'tag_summary', 'ts_id', 'tag_summary_ts_id_seq' ],
                        [ 'setSequenceOwner', 'sites', 'site_id', 'sites_site_id_seq' ],
+
+                       // 1.32
+                       [ 'addTable', 'change_tag_def', 'patch-change_tag_def.sql' ],
+                       [ 'populateExternallinksIndex60' ],
+                       [ 'dropDefault', 'externallinks', 'el_index_60' ],
+                       [ 'runMaintenance', DeduplicateArchiveRevId::class, 'maintenance/deduplicateArchiveRevId.php' ],
                ];
        }
 
@@ -904,6 +910,20 @@ END;
                }
        }
 
+       /**
+        * Drop a default value from a field
+        * @since 1.32
+        * @param string $table
+        * @param string $field
+        */
+       protected function dropDefault( $table, $field ) {
+               $info = $this->db->fieldInfo( $table, $field );
+               if ( $info->defaultValue() !== false ) {
+                       $this->output( "Removing '$table.$field' default value\n" );
+                       $this->db->query( "ALTER TABLE $table ALTER $field DROP DEFAULT" );
+               }
+       }
+
        protected function changeNullableField( $table, $field, $null, $update = false ) {
                $fi = $this->db->fieldInfo( $table, $field );
                if ( is_null( $fi ) ) {