function spaces_schema in Spaces 7
Same name and namespace in other branches
- 6.3 spaces.install \spaces_schema()
- 6 spaces.install \spaces_schema()
- 6.2 spaces.install \spaces_schema()
- 7.3 spaces.install \spaces_schema()
Implements hook_schema().
File
- ./
spaces.install, line 35 - Install, update and uninstall functions for the spaces module.
Code
function spaces_schema() {
$schema = array();
$schema['spaces_overrides'] = array(
'description' => 'Object overrides per space.',
'fields' => array(
'type' => array(
'description' => 'The space type.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'id' => array(
'description' => 'The space id.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'object_type' => array(
'description' => 'The override object type.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'object_id' => array(
'description' => 'The override object id.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'value' => array(
'description' => 'Serialized storage of space-specific override values.',
'type' => 'text',
'serialize' => TRUE,
),
),
'indexes' => array(
'space' => array(
'type',
'id',
),
'object' => array(
'object_type',
'object_id',
),
),
);
$schema['spaces_presets'] = array(
'description' => 'Spaces presets.',
'export' => array(
'key' => 'name',
'identifier' => 'spaces_presets',
'default hook' => 'spaces_presets',
'status' => 'spaces_preset_status',
'api' => array(
'owner' => 'spaces',
'api' => 'spaces',
// Base name for api include files.
'minimum_version' => 3,
'current_version' => 3,
),
'export callback' => 'spaces_preset_export',
),
'fields' => array(
'name' => array(
'description' => 'The preset string identifier.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'title' => array(
'description' => 'The human-readable name for this preset.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'description' => array(
'description' => 'The description for this preset.',
'type' => 'text',
),
'space_type' => array(
'description' => 'The space type for which this preset applies.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'value' => array(
'description' => 'A serialized array that represents this preset\'s definition.',
'type' => 'text',
'serialize' => TRUE,
),
),
'primary key' => array(
'name',
),
'indexes' => array(
'type' => array(
'space_type',
),
),
);
return $schema;
}