You are here

function ds_schema in Display Suite 7

Same name and namespace in other branches
  1. 6.3 ds.install \ds_schema()
  2. 6.2 ds.install \ds_schema()
  3. 7.2 ds.install \ds_schema()

Implements hook_schema().

2 calls to ds_schema()
ds_update_7002 in ./ds.install
Updates the ds_layout_settings table.
ds_update_7004 in ./ds.install
Updates the ds_layout_settings table.

File

./ds.install, line 67
Display suite install file.

Code

function ds_schema() {
  $schema['ds_field_settings'] = array(
    'description' => 'The table that holds display suite field settings per display.',
    // CTools export definitions.
    'export' => array(
      'key' => 'id',
      'identifier' => 'ds_fieldsetting',
      'default hook' => 'ds_field_settings_info',
      'can disable' => FALSE,
      'api' => array(
        'owner' => 'ds',
        'api' => 'ds',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'id' => array(
        'description' => 'The unique id this setting.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'entity_type' => array(
        'description' => 'The name of the entity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'bundle' => array(
        'description' => 'The name of the entity.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'view_mode' => array(
        'description' => 'The name of the view_mode.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'description' => 'The display suite field settings for this layout.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'ds_entity' => array(
        'entity_type',
      ),
      'ds_bundle' => array(
        'bundle',
      ),
      'ds_view_mode' => array(
        'view_mode',
      ),
    ),
  );
  $schema['ds_layout_settings'] = array(
    'description' => 'The table that holds the layouts configuration.',
    // CTools export definitions.
    'export' => array(
      'key' => 'id',
      'identifier' => 'ds_layout',
      'default hook' => 'ds_layout_settings_info',
      'can disable' => FALSE,
      'api' => array(
        'owner' => 'ds',
        'api' => 'ds',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'id' => array(
        'description' => 'The unique id the layout.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'entity_type' => array(
        'description' => 'The name of the entity.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'bundle' => array(
        'description' => 'The name of the entity.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'view_mode' => array(
        'description' => 'The name of the view_mode.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'layout' => array(
        'description' => 'The name of the layout.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'description' => 'The settings for this layout.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'ds_entity' => array(
        'entity_type',
      ),
      'ds_bundle' => array(
        'bundle',
      ),
      'ds_view_mode' => array(
        'view_mode',
      ),
    ),
  );
  $schema['ds_view_modes'] = array(
    'description' => 'The table that holds custom view modes managed by Display Suite.',
    // CTools export definitions.
    'export' => array(
      'key' => 'view_mode',
      'identifier' => 'ds_view_mode',
      'default hook' => 'ds_view_modes_info',
      'can disable' => FALSE,
      'api' => array(
        'owner' => 'ds',
        'api' => 'ds',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'view_mode' => array(
        'description' => 'The machine name of the view mode.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The label of the view mode.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'entities' => array(
        'description' => 'The entities for this view mode.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'view_mode',
    ),
  );
  $schema['ds_fields'] = array(
    'description' => 'The table that holds custom fields managed by Display Suite.',
    // CTools export definitions.
    'export' => array(
      'key' => 'field',
      'identifier' => 'ds_field',
      'default hook' => 'ds_custom_fields_info',
      'can disable' => FALSE,
      'api' => array(
        'owner' => 'ds',
        'api' => 'ds',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'field' => array(
        'description' => 'The machine name of the field.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The label of the field.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'field_type' => array(
        'description' => 'The type of of the field',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'entities' => array(
        'description' => 'The entities for this field.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'properties' => array(
        'description' => 'The properties for this field.',
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'field',
    ),
  );
  return $schema;
}