You are here

function spaces_schema in Spaces 6.3

Same name and namespace in other branches
  1. 6 spaces.install \spaces_schema()
  2. 6.2 spaces.install \spaces_schema()
  3. 7.3 spaces.install \spaces_schema()
  4. 7 spaces.install \spaces_schema()

Implementation of hook_schema()

1 call to spaces_schema()
spaces_update_6001 in ./spaces.install
Update script 6001.

File

./spaces.install, line 27

Code

function spaces_schema() {
  $schema = array();
  $schema['spaces_overrides'] = array(
    'description' => t('Object overrides per space.'),
    'fields' => array(
      'type' => array(
        'description' => t('The space type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => t('The space id.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'object_type' => array(
        'description' => t('The override object type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'object_id' => array(
        'description' => t('The override object id.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => t('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' => t('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' => t('The preset string identifier.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => t('The human-readable name for this preset.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => t('The description for this preset.'),
        'type' => 'text',
      ),
      'space_type' => array(
        'description' => t('The space type for which this preset applies.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => t('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;
}