You are here

function image_replace_schema in Image Replace 8

Same name and namespace in other branches
  1. 7 image_replace.install \image_replace_schema()

Implements hook_schema().

File

./image_replace.install, line 13
Database schema for image replace module.

Code

function image_replace_schema() {
  $schema['image_replace'] = [
    'description' => 'Stores a map of image replacements for certain styles.',
    'fields' => [
      'target_style' => [
        'description' => 'The style machine name.',
        'type' => 'varchar_ascii',
        'length' => 255,
        'not null' => TRUE,
      ],
      'target_uri_hash' => [
        'description' => 'Hash of target uris. Used as part of primary key',
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
        'default' => '',
      ],
      'replacement_uri' => [
        'description' => 'The replacement URI to use instead.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'binary' => TRUE,
      ],
    ],
    'primary key' => [
      'target_style',
      'target_uri_hash',
    ],
  ];
  return $schema;
}