]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/installer/OracleUpdater.php
MediaWiki 1.17.1
[autoinstallsdev/mediawiki.git] / includes / installer / OracleUpdater.php
index 4d85924ee5ac3e0549552a8bd929bf1a242681be..7664a4187d2e8d505e5629310e9cd3ab88658257 100644 (file)
@@ -21,6 +21,7 @@ class OracleUpdater extends DatabaseUpdater {
                        array( 'doFunctions17' ),
                        array( 'doSchemaUpgrade17' ),
                        array( 'doInsertPage0' ),
+                       array( 'doRemoveNotNullEmptyDefaults' ),
                );
        }
 
@@ -102,6 +103,21 @@ class OracleUpdater extends DatabaseUpdater {
                $this->output( "ok\n" );
        }
 
+       /**
+        * Remove DEFAULT '' NOT NULL constraints from fields as '' is internally
+        * converted to NULL in Oracle
+        */
+       protected function doRemoveNotNullEmptyDefaults() {
+               $this->output( "Removing not null empty constraints ... " );
+               $meta = $this->db->fieldInfo( 'categorylinks' , 'cl_sortkey_prefix' );
+               if ( $meta->isNullable() ) {
+                       $this->output( "constraints seem to be removed\n" );
+                       return;
+               }
+               $this->applyPatch( 'patch_remove_not_null_empty_defs.sql', false );
+               $this->output( "ok\n" );
+       }
+
        /**
         * Overload: after this action field info table has to be rebuilt
         */