Merge "Add attributes parameter to ShowSearchHitTitle"
[lhc/web/wiklou.git] / includes / installer / OracleUpdater.php
index e262eda..040b54a 100644 (file)
@@ -123,6 +123,10 @@ class OracleUpdater extends DatabaseUpdater {
                        [ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ],
                        [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ],
 
+                       // 1.30
+                       [ 'doAutoIncrementTriggers' ],
+                       [ 'addIndex', 'site_stats', 'PRIMARY', 'patch-site_stats-pk.sql' ],
+
                        // KEEP THIS AT THE BOTTOM!!
                        [ 'doRebuildDuplicateFunction' ],
 
@@ -273,6 +277,30 @@ class OracleUpdater extends DatabaseUpdater {
                $this->output( "ok\n" );
        }
 
+       /**
+        * Add auto-increment triggers
+        */
+       protected function doAutoIncrementTriggers() {
+               $this->output( "Adding auto-increment triggers ... " );
+
+               $meta = $this->db->query( 'SELECT trigger_name FROM user_triggers WHERE table_owner = \'' .
+                       strtoupper( $this->db->getDBname() ) .
+                       '\' AND trigger_name = \'' .
+                       $this->db->tablePrefix() .
+                       'PAGE_DEFAULT_PAGE_ID\''
+               );
+               $row = $meta->fetchRow();
+               if ( $row['column_name'] ) {
+                       $this->output( "seems to be up to date.\n" );
+
+                       return;
+               }
+
+               $this->applyPatch( 'patch-auto_increment_triggers.sql', false );
+
+               $this->output( "ok\n" );
+       }
+
        /**
         * rebuilding of the function that duplicates tables for tests
         */