function avatar_selection_schema in Avatar Selection 7
Same name and namespace in other branches
- 6 avatar_selection.install \avatar_selection_schema()
Implements hook_schema().
Generate the 'avatar_selection' sql table structure.
Return value
$schema The sql table structure.
File
- ./
avatar_selection.install, line 16 - The Avatar Selection module install file.
Code
function avatar_selection_schema() {
$schema['avatar_selection'] = array(
'description' => 'List of available avatars and their names.',
'fields' => array(
'aid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Avatar identifier.',
),
'fid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'File identifier.',
),
'avatar' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'Avatar image filename.',
),
'name' => array(
'type' => 'varchar',
'length' => 255,
'description' => 'Avatar name.',
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Avatar weight.',
),
),
'primary key' => array(
'aid',
),
'unique keys' => array(
'avatar' => array(
'avatar',
),
'fid' => array(
'fid',
),
),
);
$schema['avatar_selection_roles'] = array(
'fields' => array(
'aid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Avatar identifier.',
),
'rid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Role identifier.',
),
),
);
$schema['avatar_selection_og'] = array(
'fields' => array(
'aid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Avatar identifier.',
),
'ogid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Organic group identifier.',
),
),
);
$schema['avatar_selection_usage'] = array(
'fields' => array(
'fid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Avatar identifier.',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Role identifier.',
),
),
'primary key' => array(
'uid',
),
);
return $schema;
}