You are here

function spaces_schema in Spaces 6

Same name and namespace in other branches
  1. 6.3 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 37

Code

function spaces_schema() {
  $schema = array();
  $schema['spaces'] = array(
    'description' => t('spaces.'),
    'fields' => array(
      'sid' => array(
        'description' => t('The space id.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => t('The space type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'preset' => array(
        'description' => t('The space preset.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'customizer' => array(
        'description' => t('The spaces customizer stored as a serialized array.'),
        'type' => 'text',
        'size' => 'big',
      ),
    ),
    'unique keys' => array(
      'key1' => array(
        'sid',
        'type',
      ),
    ),
  );
  $schema['spaces_presets'] = array(
    'description' => t('spaces presets.'),
    'fields' => array(
      'type' => array(
        'description' => t('The space type for which this preset applies.'),
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => t('The preset string identifier.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'name' => 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',
        'size' => 'big',
      ),
      'value' => array(
        'description' => t('A serialized array that represents this preset\'s definition.'),
        'type' => 'text',
        'size' => 'big',
      ),
    ),
    'unique keys' => array(
      'key1' => array(
        'type',
        'id',
      ),
    ),
  );
  $schema['spaces_settings'] = array(
    'description' => t('spaces settings.'),
    'fields' => array(
      'sid' => array(
        'description' => t('The space id.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => t('The space type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => t('The spaces setting identifer.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => t('A serialized array that represents this setting\'s custom value(s).'),
        'type' => 'text',
        'size' => 'big',
      ),
    ),
    'unique keys' => array(
      'key1' => array(
        'type',
        'sid',
        'id',
      ),
    ),
  );
  $schema['spaces_features'] = array(
    'description' => t('spaces features.'),
    'fields' => array(
      'sid' => array(
        'description' => t('The space id.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => t('The space type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => t('The spaces feature identifer.'),
        'type' => 'text',
        'size' => 'big',
      ),
      'value' => array(
        'description' => t('A serialized array that represents this feature\'s custom value(s).'),
        'type' => 'text',
        'size' => 'big',
      ),
      'weight' => array(
        'description' => t('A weight value for this feature.'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'type' => array(
        'type',
        'sid',
      ),
    ),
  );
  return $schema;
}