You are here

function dynamic_background_schema in Dynamic Background 7.2

Implements hook_schema().

File

./dynamic_background.install, line 11
Installation file for dynamic background, currently only the uninstall function is present.

Code

function dynamic_background_schema() {
  $schema = array();
  $schema['dynamic_background_usage'] = array(
    'description' => 'Stores information about the usage of dynamic background images',
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier for a dynamic background image.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'The {file_managed}.fid identifier for the uploaded file.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'Used to indicate which extension/module uploaded the image.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => 'Extra information, which may be used be extension to store local information',
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
    ),
    'foreign keys' => array(
      'file' => array(
        'table' => 'file_managed',
        'columns' => array(
          'fid' => 'fid',
        ),
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );

  // Dynamic background images table.
  $schema['dynamic_background_images'] = array(
    'description' => 'Stores information about the images uploaded',
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier for a dynamic background image.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'The {file_managed}.fid identifier for the uploaded file.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'Extra information, which may be used be extension to store local information',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'extension' => array(
        'description' => 'Used to indicate which extension/module uploaded the image.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'extension' => array(
        'extension',
      ),
    ),
    'foreign keys' => array(
      'file' => array(
        'table' => 'file_managed',
        'columns' => array(
          'fid' => 'fid',
        ),
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}