You are here

function brilliant_gallery_schema in Brilliant Gallery 7

Same name and namespace in other branches
  1. 6.4 brilliant_gallery.install \brilliant_gallery_schema()
  2. 6 brilliant_gallery.install \brilliant_gallery_schema()
  3. 6.2 brilliant_gallery.install \brilliant_gallery_schema()
  4. 6.3 brilliant_gallery.install \brilliant_gallery_schema()
  5. 7.2 brilliant_gallery.install \brilliant_gallery_schema()

Implements hook_schema().

File

./brilliant_gallery.install, line 12
Install, update and uninstall functions for the brilliant_gallery module.

Code

function brilliant_gallery_schema() {
  $schema = array();
  $schema['brilliant_gallery_checklist'] = array(
    'description' => t('Table tracing which Brilliant Gallery images are hidden or visible.'),
    'fields' => array(
      'nid' => array(
        'description' => t('Unused now.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'size' => 'normal',
        'default' => 0,
      ),
      'user' => array(
        'description' => t('User ID.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'size' => 'normal',
        'default' => 0,
      ),
      'qid' => array(
        'description' => t('Image.'),
        'type' => 'text',
        #'unsigned' => FALSE,
        'not null' => TRUE,
        'size' => 'normal',
      ),
      'state' => array(
        'description' => t('Visible or invisible.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'size' => 'normal',
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'user',
      array(
        'qid',
        255,
      ),
    ),
  );
  $schema['brilliant_gallery_image_arrays'] = array(
    'description' => 'Binds image property array with its hash that is present in the cached file name and in the URL.',
    'fields' => array(
      'hash' => array(
        'description' => 'Hash of the serialized array.',
        'type' => 'varchar',
        'length' => '32',
        'not null' => TRUE,
      ),
      'array' => array(
        'description' => 'Array of image parametres.',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'datetime' => array(
        'description' => 'Date and time of last value refresh.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'hash',
    ),
    'indexes' => array(
      'datetime' => array(
        'datetime',
      ),
    ),
  );
  return $schema;
}