array( array( 'table' => 'downloads_categories', 'old' => 'conv_parent', 'new' => 'cconv_parent' ) ), 'gallery' => array( array( 'table' => 'gallery_categories', 'old' => 'conv_parent', 'new' => 'category_conv_parent' ) ), 'cms' => array( array( 'table' => 'cms_database_categories', 'old' => 'conv_parent', 'new' => 'category_conv_parent', ) ), 'nexus' => array( array( 'table' => 'nexus_package_groups', 'old' => 'conv_pg_parent', 'new' => 'pg_conv_parent' ), array( 'table' => 'nexus_packages', 'old' => 'conv_p_associable', 'new' => 'p_conv_associable' ), array( 'table' => 'nexus_purchases', 'old' => 'conv_ps_parent', 'new' => 'ps_conv_parent' ) ) ); foreach( $old AS $app => $tables ) { foreach( $tables AS $data ) { /* Does the table and old column exist? */ if ( \IPS\Db::i()->checkForTable( $data['table'] ) AND \IPS\Db::i()->checkForColumn( $data['table'], $data['old'] ) ) { /* Does the new column exist? */ if ( \IPS\Db::i()->checkForColumn( $data['table'], $data['new'] ) ) { /* Drop it */ \IPS\Db::i()->dropColumn( $data['table'], $data['new'] ); } /* Alter the old one */ \IPS\Db::i()->changeColumn( $data['table'], $data['old'], array( 'name' => $data['new'], 'type' => 'BIGINT', 'length' => 20, 'default' => 0 ) ); } } } return TRUE; } }