Skip to content
Snippets Groups Projects
Commit 160fd16c authored by Tim Steiner's avatar Tim Steiner
Browse files

More updating to drupal coding standards.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@208 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 4e005fd2
No related branches found
No related tags found
No related merge requests found
<?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');
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment