diff --git a/sites/all/modules/unl/unl.install b/sites/all/modules/unl/unl.install index 04381439272e9fa4b6ee5a4ef9bd02f87ef09fb1..6f6902dbf611483e541470ed6f5a327a2152680b 100644 --- a/sites/all/modules/unl/unl.install +++ b/sites/all/modules/unl/unl.install @@ -1,129 +1,117 @@ <?php -function unl_schema() -{ - $schema = array(); - $schema['unl_sites'] = array( - 'description' => 'Table of tables to be programatically created', - 'fields' => array( - 'site_id' => array( - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE - ), - 'site_path_prefix' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - 'site_path' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - 'uri' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - 'installed' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0 - ), - 'clean_url' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 1 - ) - ), - 'primary key' => array('site_id'), - 'unique keys' => array( - 'sub_site' => array('site_path_prefix', 'site_path') - ) - ); - - - return $schema; +function unl_schema() { + $schema = array(); + $schema['unl_sites'] = array( + 'description' => 'Table of tables to be programatically created', + 'fields' => array( + 'site_id' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'site_path_prefix' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'site_path' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'uri' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'installed' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'clean_url' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + ) + ), + 'primary key' => array('site_id'), + 'unique keys' => array( + 'sub_site' => array('site_path_prefix', 'site_path'), + ) + ); + + + return $schema; } -function unl_update_7100() -{ - $table = array( - 'description' => 'Table of tables to be programatically created', - 'fields' => array( - 'site_id' => array( - 'type' => 'serial', - 'unsigned' => TRUE, - 'not null' => TRUE - ), - 'site_path' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - 'uri' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - 'installed' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0 - ), - 'clean_url' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 1 - ), - 'db_prefix' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ), - ), - 'primary key' => array('site_id'), - 'unique keys' => array( - 'sub_site' => array('site_path_prefix', 'site_path') - ) - ); - - db_create_table('unl_sites', $table); +function unl_update_7100() { + $table = array( + 'description' => 'Table of tables to be programatically created', + 'fields' => array( + 'site_id' => array( + 'type' => 'serial', + 'unsigned' => TRUE, + 'not null' => TRUE, + ), + 'site_path' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'uri' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'installed' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'clean_url' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + ), + 'db_prefix' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ) + ), + 'primary key' => array('site_id'), + 'unique keys' => array( + 'sub_site' => array('site_path_prefix', 'site_path'), + ) + ); + + db_create_table('unl_sites', $table); } -function unl_update_7101() -{ - db_add_field( - 'unl_sites', - 'clean_url', - array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 1 - ) - ); +function unl_update_7101() { + db_add_field('unl_sites', 'clean_url', array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + )); } -function unl_update_7102() -{ - db_add_field( - 'unl_sites', - 'db_prefix', - array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '' - ) - ); - db_query('UPDATE {unl_sites} SET db_prefix = site_path'); - db_query("UPDATE {unl_sites} SET site_path = CONCAT(site_path_prefix, '/', site_path) WHERE site_path_prefix != ''"); - db_drop_field('unl_sites', 'site_path_prefix'); +function unl_update_7102() { + db_add_field('unl_sites', 'db_prefix', array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + )); + db_query('UPDATE {unl_sites} SET db_prefix = site_path'); + db_query("UPDATE {unl_sites} SET site_path = CONCAT(site_path_prefix, '/', site_path) WHERE site_path_prefix != ''"); + db_drop_field('unl_sites', 'site_path_prefix'); }