You are here

function imagepicker_schema in Image Picker 7

Same name and namespace in other branches
  1. 6.2 imagepicker.install \imagepicker_schema()

Implements hook_schema().

File

./imagepicker.install, line 30
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_schema() {
  $schema['imagepicker'] = array(
    'description' => 'The image table',
    'fields' => array(
      'img_id' => array(
        'description' => 'The primary image identifier.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The user identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'img_name' => array(
        'description' => 'The image name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'img_title' => array(
        'description' => 'The image title',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'img_description' => array(
        'description' => 'The image description',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'img_date' => array(
        'description' => 'The image date',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'primary key' => array(
      'img_id',
    ),
  );
  $schema['imagepicker_user_groups'] = array(
    'description' => 'The groups table',
    'fields' => array(
      'gid' => array(
        'description' => 'The primary group identifier.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => 'The user identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'group_name' => array(
        'description' => 'The group name.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'group_description' => array(
        'description' => 'The group description.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'state' => array(
        'description' => 'The currently selected group.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'public' => array(
        'description' => 'The public flag.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'avail_roles' => array(
        'description' => 'List of roles that may view this group.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'all',
      ),
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
    'primary key' => array(
      'gid',
    ),
  );
  $schema['imagepicker_group_images'] = array(
    'fields' => array(
      'gid' => array(
        'description' => 'The group identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'img_id' => array(
        'description' => 'The image identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'gid' => array(
        'gid',
      ),
      'img_id' => array(
        'img_id',
      ),
    ),
  );
  $schema['imagepicker_variables'] = array(
    'fields' => array(
      'name' => array(
        'description' => t('imagepicker variables.'),
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => t('imagepicker variable values.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => t('The user identifier.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}