You are here

function file_styles_schema in Styles 7

Same name and namespace in other branches
  1. 7.2 contrib/file_styles/file_styles.install \file_styles_schema()

Implement hook_schema().

File

contrib/file_styles/file_styles.install, line 29
Install, update and uninstall functions for the file styles module.

Code

function file_styles_schema() {
  $schema = array();
  $schema['cache_file_styles'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_file_styles']['description'] = 'Cache table used to store information file manipulations that are in-progress.';
  $schema['file_styles'] = array(
    'description' => 'Stores configuration options for file styles.',
    'fields' => array(
      'msid' => array(
        'description' => 'The primary identifier for a file style.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The style name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'msid',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['file_effects'] = array(
    'description' => 'Stores configuration options for file effects.',
    'fields' => array(
      'meid' => array(
        'description' => 'The primary identifier for an file effect.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'msid' => array(
        'description' => 'The {file_styles}.isid for a file style.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'description' => 'The weight of the effect in the style.',
        'type' => 'int',
        'unsigned' => FALSE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => 'The unique name of the effect to be executed.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'The configuration data for the effect.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'meid',
    ),
    'indexes' => array(
      'msid' => array(
        'msid',
      ),
      'weight' => array(
        'weight',
      ),
    ),
    'foreign keys' => array(
      'msid' => array(
        'file_styles' => 'msid',
      ),
    ),
  );
  return $schema;
}