diff options
| author | Christian Fowler <spider@viovio.com> | 2009-03-25 02:32:49 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-03-25 02:32:49 +0000 |
| commit | 7d05631c812de72614f1ad55fe222bc85c72f9ba (patch) | |
| tree | c4cdda150bb723f3c3f66abcba3dc0fc4a279cab /admin | |
| parent | 256599f2fd9b68ec818323d87da90b61c1a74440 (diff) | |
| download | liberty-7d05631c812de72614f1ad55fe222bc85c72f9ba.tar.gz liberty-7d05631c812de72614f1ad55fe222bc85c72f9ba.tar.bz2 liberty-7d05631c812de72614f1ad55fe222bc85c72f9ba.zip | |
change ip to IPv6 compliance (39 chars). add upgrades files and remove registerPackageVersion where redundant
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/schema_inc.php | 4 | ||||
| -rw-r--r-- | admin/upgrades/2.1.3.php | 42 |
2 files changed, 44 insertions, 2 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 85085dc..5371a1d 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -66,7 +66,7 @@ $tables = array( format_guid C(16) NOTNULL, summary XL, user_id I4 NOTNULL, - ip C(15), + ip C(39), history_comment C(200), data XL CONSTRAINT ', CONSTRAINT `liberty_history_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` )' @@ -77,7 +77,7 @@ $tables = array( user_id I4 NOTNULL, last_modified I8 NOTNULL, title C(160), - ip C(15), + ip C(39), log_message C(250) NOTNULL DEFAULT '', error_message C(250) NOTNULL DEFAULT '' ", diff --git a/admin/upgrades/2.1.3.php b/admin/upgrades/2.1.3.php new file mode 100644 index 0000000..ee6ead5 --- /dev/null +++ b/admin/upgrades/2.1.3.php @@ -0,0 +1,42 @@ +<?php +/** + * @version $Header: /cvsroot/bitweaver/_bit_liberty/admin/upgrades/2.1.3.php,v 1.1 2009/03/25 02:32:49 spiderr Exp $ + */ +global $gBitInstaller; + +$infoHash = array( + 'package' => LIBERTY_PKG_NAME, + 'version' => str_replace( '.php', '', basename( __FILE__ )), + 'description' => "Minor fix to ip columns to support IPv6", + 'post_upgrade' => NULL, +); + +// all we are doing is change the column type of user_id for liberty_content_history. +// postgresql < 8.2 doesn't allow easy column type changing +// and therefore we need to undergo this annoying dance. +$gBitInstaller->registerPackageUpgrade( $infoHash, array( + +// copy data into new column +array( 'QUERY' => + // postgres > 8.2 needs to have the type cast + array( + 'PGSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."users_cnxn ALTER `ip` TYPE VARCHAR(39)" , + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content ALTER `ip` TYPE VARCHAR(39)", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content_history` ALTER `ip` TYPE VARCHAR(39)", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_action_log` ALTER `ip` TYPE VARCHAR(39)", + ), + 'OCI' => array( "ALTER TABLE `".BIT_DB_PREFIX."users_cnxn MODIFY (`ip` TYPE VARCHAR2(39))" , + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content MODIFY (`ip` TYPE VARCHAR2(39))", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content_history` MODIFY (`ip` TYPE VARCHAR2(39))", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_action_log` MODIFY (`ip` TYPE VARCHAR2(39))", + ), + 'MYSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."users_cnxn MODIFY `ip` TYPE VARCHAR(39)" , + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content MODIFY `ip` TYPE VARCHAR(39)", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_content_history` MODIFY `ip` TYPE VARCHAR(39)", + "ALTER TABLE `".BIT_DB_PREFIX."liberty_action_log` MODIFY `ip` TYPE VARCHAR(39)", + ), + ), +), + +)); +?> |
