View source
<?php
function override_css_install() {
}
function override_css_uninstall() {
}
function override_css_schema() {
$schema['override_css'] = array(
'description' => 'The table that holds override css settings.',
'export' => array(
'key' => 'name',
'key name' => 'Name',
'primary key' => 'name',
'identifier' => 'override_css',
'default hook' => 'override_css_defaults',
'status callback' => 'override_css_crud_set_status',
'api' => array(
'owner' => 'override_css',
'api' => 'override_css',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'name' => array(
'description' => 'The unique machine name of this setting.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => 'The human readable name of this setting.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => 'The description of the selectors.',
'type' => 'text',
'not null' => FALSE,
'size' => 'medium',
),
'bundle' => array(
'description' => 'The name of the bundle of this css selector.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'selectors' => array(
'description' => 'The selectors.',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
),
'properties' => array(
'description' => 'The available properties for the selectors.',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
),
),
'primary key' => array(
'name',
),
);
$schema['override_css_properties'] = array(
'description' => 'The table that holds override css properties.',
'fields' => array(
'name' => array(
'description' => 'The unique machine name of this setting.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'properties_values' => array(
'description' => 'The values of the properties.',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
),
),
'primary key' => array(
'name',
),
);
return $schema;
}
function override_css_update_7100() {
$schema = override_css_schema();
db_create_table('override_css_properties', $schema['override_css_properties']);
$query = db_select('override_css', 'o')
->fields('o', array(
'name',
'properties_values',
));
db_insert('override_css_properties')
->fields(array(
'name',
'properties_values',
))
->from($query)
->execute();
db_drop_field('override_css', 'properties_values');
}
function override_css_update_7101() {
$spec = array(
'description' => 'The name of the bundle of this css selector.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
);
db_add_field('override_css', 'bundle', $spec);
}