function imagepicker_schema in Image Picker 6.2
Same name and namespace in other branches
- 7 imagepicker.install \imagepicker_schema()
Implementation of hook_schema().
File
- ./
imagepicker.install, line 30 - imagepicker install, update and uninstall functions
Code
function imagepicker_schema() {
$schema['imagepicker'] = array(
'description' => t('The image table'),
'fields' => array(
'img_id' => array(
'description' => t('The primary image identifier.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'description' => t('The user identifier.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'img_name' => array(
'description' => t('The image name'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'img_title' => array(
'description' => t('The image title'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'img_description' => array(
'description' => t('The image description'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'img_date' => array(
'description' => t('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' => t('The groups table'),
'fields' => array(
'gid' => array(
'description' => t('The primary group identifier.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'description' => t('The user identifier.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'group_name' => array(
'description' => t('The group name.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'group_description' => array(
'description' => t('The group description.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'state' => array(
'description' => t('The currently selected group.'),
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'public' => array(
'description' => t('The public flag.'),
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'avail_roles' => array(
'description' => t('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' => t('The group identifier.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'img_id' => array(
'description' => t('The image identifier.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'gid' => array(
'gid',
),
'img_id' => array(
'img_id',
),
),
);
return $schema;
}