diff options
Diffstat (limited to 'admin/upgrades/1.0.0.php')
| -rw-r--r-- | admin/upgrades/1.0.0.php | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/admin/upgrades/1.0.0.php b/admin/upgrades/1.0.0.php deleted file mode 100644 index dcb3003..0000000 --- a/admin/upgrades/1.0.0.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - */ -global $gBitInstaller; - -$infoHash = array( - 'package' => WIKI_PKG_NAME, - 'version' => str_replace( '.php', '', basename( __FILE__ )), - 'description' => "Minor fix to user_id column type in wiki_footnotes.", - 'post_upgrade' => NULL, -); - -// all we are doing is change the column type of user_id for wiki_footnotes. -// postgresql < 8.2 doesn't allow easy column type changing -// and therefore we need to undergo this annoying dance. -$gBitInstaller->registerPackageUpgrade( $infoHash, array( - -array( 'DATADICT' => array( - // rename original column - array( 'RENAMECOLUMN' => array( - 'wiki_footnotes' => array( - '`user_id`' => "`temp_column` VARCHAR(40)", - ), - )), - // insert new column - array( 'ALTER' => array( - 'wiki_footnotes' => array( - 'user_id' => array( '`user_id`', 'I4' ), - ))), -)), - -// copy data into new column -array( 'QUERY' => - // postgres > 8.2 needs to have the type cast - array( - 'PGSQL' => array( "UPDATE `".BIT_DB_PREFIX."wiki_footnotes` SET `user_id` = `temp_column`::integer" ), - 'SQL92' => array( "UPDATE `".BIT_DB_PREFIX."wiki_footnotes` SET `user_id` = `temp_column`" ), - ), -), - -array( 'DATADICT' => array( - // drop old column - array( 'DROPCOLUMN' => array( - 'wiki_footnotes' => array( '`temp_column`' ), - )), - // reconstruct constraints, sequences and indexes -)), - -)); -?> |
