You are here

function resp_img_schema in Responsive images and styles 7

Same name and namespace in other branches
  1. 7.2 resp_img.install \resp_img_schema()

Implementation of hook_schema().

File

./resp_img.install, line 6

Code

function resp_img_schema() {
  $schema['resp_img_suffix'] = array(
    'description' => 'Defines responsive images suffix\'',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'The internal identifier for a responsive images suffix',
        'no export' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'The name of the suffix.',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'The label of the suffix.',
        'default' => '',
      ),
      'suffix' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'The suffix.',
        'not null' => TRUE,
        'default' => '',
      ),
      'breakpoint' => array(
        'type' => 'int',
        'description' => 'The breakpoint in pixels for this suffix',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'indexes' => array(
      'suffix' => array(
        'suffix',
      ),
    ),
    // CTools exportable object definition
    'export' => array(
      'key' => 'name',
      'key name' => 'suffix name',
      'primary key' => 'id',
      'identifier' => 'resp_img_suffix',
      'admin_title' => 'label',
      'default hook' => 'default_resp_img_suffixs',
      'api' => array(
        'owner' => 'resp_img',
        'api' => 'default_resp_img_suffixs',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
  );
  return $schema;
}