function styles_schema in Styles 7.2
Same name and namespace in other branches
- 6.2 styles.install \styles_schema()
- 6 styles.install \styles_schema()
- 7 styles.install \styles_schema()
Implement hook_schema().
File
- ./
styles.install, line 31 - Install, update and uninstall functions for the Styles module.
Code
function styles_schema() {
$schema = array();
$schema['cache_styles'] = drupal_get_schema_unprocessed('system', 'cache');
$schema['cache_styles']['description'] = 'Cache table used to store information display manipulations that are in-progress.';
$schema['styles'] = array(
'description' => 'Stores configuration options for styles.',
'fields' => array(
'sid' => array(
'description' => 'The primary identifier for a style.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'field_type' => array(
'description' => 'The field type.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'name' => array(
'description' => 'The style name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'description' => array(
'description' => 'The style description.',
'type' => 'text',
'not null' => TRUE,
'size' => 'big',
),
),
'primary key' => array(
'sid',
),
'indexes' => array(
'field_type' => array(
'field_type',
),
'name' => array(
'name',
),
),
);
$schema['styles_presets'] = array(
'description' => 'Stores configuration options for styles presets.',
'fields' => array(
'pid' => array(
'description' => 'The primary identifier for a style preset.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'field_type' => array(
'description' => 'The field type.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'container_name' => array(
'description' => 'The container name',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'name' => array(
'description' => 'The preset name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
),
'primary key' => array(
'pid',
),
'indexes' => array(
'field_type' => array(
'field_type',
),
'container_name' => array(
'container_name',
),
'name' => array(
'name',
),
),
);
$schema['styles_preset_instances'] = array(
'description' => 'Stores the settings for each container/style preset.',
'fields' => array(
'sid' => array(
'description' => 'The primary identifier for a style.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'pid' => array(
'description' => 'The primary identifier for a style preset.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'foreign keys' => array(
'sid' => array(
'table' => 'styles',
'columns' => array(
'sid' => 'sid',
),
),
'pid' => array(
'table' => 'styles_presets',
'columns' => array(
'pid' => 'pid',
),
),
),
'indexes' => array(
'sid' => array(
'sid',
),
'pid' => array(
'pid',
),
),
);
return $schema;
}