diff options
| author | wjames5 <will@tekimaki.com> | 2010-04-17 22:46:09 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2010-04-17 22:46:09 +0000 |
| commit | 6e0a355aefc3ca36b2afe7bc8d65c093de77beea (patch) | |
| tree | 8f73e8476b4719a1f11d0a52590caf07d5a8dbcf /admin | |
| parent | ae447631fa498f779f70fb3dd500f6ea37bf224a (diff) | |
| download | liberty-6e0a355aefc3ca36b2afe7bc8d65c093de77beea.tar.gz liberty-6e0a355aefc3ca36b2afe7bc8d65c093de77beea.tar.bz2 liberty-6e0a355aefc3ca36b2afe7bc8d65c093de77beea.zip | |
SCHEMA CHANGE - liberty_content_types - change content_description to content_name, add column content_name_plural - update all class files and hashes where appropriate
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/schema_inc.php | 3 | ||||
| -rw-r--r-- | admin/upgrades/2.1.4.php | 42 |
2 files changed, 44 insertions, 1 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 5c6f221..0d48658 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -5,7 +5,8 @@ $tables = array( 'liberty_content_types' => " content_type_guid C(16) PRIMARY, - content_description C(250) NOTNULL, + content_name C(250) NOTNULL, + content_name_plural C(250), maintainer_url C(250), handler_class C(128), handler_package C(128), diff --git a/admin/upgrades/2.1.4.php b/admin/upgrades/2.1.4.php new file mode 100644 index 0000000..58d0228 --- /dev/null +++ b/admin/upgrades/2.1.4.php @@ -0,0 +1,42 @@ +<?php +/** + * @version $Header: /cvsroot/bitweaver/_bit_liberty/admin/upgrades/2.1.4.php,v 1.1 2010/04/17 22:46:09 wjames5 Exp $ + */ +global $gBitInstaller; + +$infoHash = array( + 'package' => LIBERTY_PKG_NAME, + 'version' => str_replace( '.php', '', basename( __FILE__ )), + 'description' => "Update content type guid table to have singular and plural names, deprecate content_description", + 'post_upgrade' => NULL, +); + +$gBitInstaller->registerPackageUpgrade( $infoHash, array( + +array( 'DATADICT' => array( + // insert new column + array( 'ALTER' => array( + 'liberty_content_types' => array( + 'content_name' => array( '`content_name`', 'VARCHAR(250) NOTNULL' ), + 'content_name_plural' => array( '`content_name_plural`', 'VARCHAR(250)' ), + ))), +)), + +// copy data into new column +array( 'QUERY' => + array( + 'SQL92' => array( "UPDATE `".BIT_DB_PREFIX."liberty_content_types` SET `content_name` = `content_description`" ), + ), +), + +/* when we're read we can drop the old content_description column +array( 'DATADICT' => array( + // drop old column + array( 'DROPCOLUMN' => array( + 'liberty_content_types' => array( '`content_description`' ), + )), + // reconstruct constraints, sequences and indexes +)), +*/ + +)); |
