function gallery_assist_schema in Gallery Assist 7
Same name and namespace in other branches
- 6 gallery_assist.install \gallery_assist_schema()
Implements hook_schema().
File
- ./
gallery_assist.install, line 11 - Install, update and uninstall functions for the Gallery Assist module.
Code
function gallery_assist_schema() {
$schema['gallery_assist'] = array(
'description' => 'Gallery Assist principal table.',
'fields' => array(
'gid' => array(
'description' => 'The primary identifier for a gallery.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gref' => array(
'description' => 'The reference ID to the gallery, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'ref' => array(
'description' => 'The reference identifier to the node, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'lang' => array(
'description' => 'The language code by translations.',
'type' => 'varchar',
'length' => 8,
'not null' => TRUE,
'default' => '',
),
'nid' => array(
'description' => 'The primary identifier from the node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'uid' => array(
'description' => 'The user ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'ganame' => array(
'description' => 'The gallery name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'description' => array(
'description' => 'Gallery description on profiles. Will come later...',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'in_profile' => array(
'description' => 'Apears in the section of user profile -My Pictures-. Will come later...',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'ga_public_status' => array(
'description' => 'The public status of the gallery which can be set from owner or editor at the node editing.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'show_title' => array(
'description' => 'Show images titles by gallery group view.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'show_in_homepage_block' => array(
'description' => 'Image boxes shadow toggle.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'gallery_assist_weight' => array(
'description' => 'Weight of the gallery container by displaying the page.',
'type' => 'int',
'default' => -50,
),
'data' => array(
'description' => 'Contains the configuration data for the display galleries in the user profile. Will come later...',
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'count' => array(
'description' => 'Extra amount information. Needed for views.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'gid',
),
);
$schema['gallery_assist_item'] = array(
'description' => 'Table of the gallery assist items.',
'fields' => array(
'pid' => array(
'description' => 'The primary identifier for a gallery item.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'The primary identifier from the node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'ref' => array(
'description' => 'The reference ID to the node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'gid' => array(
'description' => 'The gallery ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'gref' => array(
'description' => 'The reference ID to the gallery, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'sid' => array(
'description' => 'The gallery ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
),
'uid' => array(
'description' => 'The user ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'fid' => array(
'description' => 'The file ID in the files table.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'filename' => array(
'description' => 'The filename in the files table.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'opath' => array(
'description' => 'The path to the original images.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'ppath' => array(
'description' => 'The path to the previews images.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'tpath' => array(
'description' => 'The path to the thumbnails images.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'weight' => array(
'description' => 'Set the items order.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'copyright' => array(
'description' => 'Copyright of images if needed.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'comments' => array(
'description' => 'Allow comments to images from galleries displayed in user profile. Will come later...',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'cover' => array(
'description' => 'The cover image of this gallery',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'aid' => array(
'description' => 'The alias (pathauto) identifier',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'created' => array(
'description' => 'The Unix timestamp when file was uploaded.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when params from the file was changed.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'type' => array(
'description' => 'Item type.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'item',
),
'type_value' => array(
'description' => 'Necessary param if type is not item.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'pid',
),
);
$schema['gallery_assist_translated'] = array(
'description' => 'Table for the multilingual manage of the fields title, caption or description etc of gallery assist items.',
'fields' => array(
'did' => array(
'description' => 'The primary identifier for a translation.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'The primary identifier from the node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gid' => array(
'description' => 'The gallery ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gref' => array(
'description' => 'The reference ID to the gallery, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'pid' => array(
'description' => 'The primary identifier for a gallery item.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'lang' => array(
'description' => 'The language code by translations.',
'type' => 'varchar',
'length' => 8,
'not null' => TRUE,
'default' => '',
),
'ptitle' => array(
'description' => 'The gallery item name.',
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'default' => '',
),
'palt' => array(
'description' => 'The filename of the gallery item image displayed as img alt.',
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'default' => '',
),
'pdescription' => array(
'description' => 'The gallery item description text.',
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
'format' => array(
'description' => 'The filter format for the pdescription.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'did',
),
);
$schema['gallery_assist_modules_settings'] = array(
'description' => 'Table to manage of the fields title, caption or description etc of gallery assist items.',
'fields' => array(
'gam' => array(
'description' => 'The primary identifier for setting entries.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'The primary identifier from the node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'ref' => array(
'description' => 'The reference ID from the node, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gid' => array(
'description' => 'The gallery ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gref' => array(
'description' => 'The reference ID from the gallery, used by translations.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'module' => array(
'description' => 'The modules settings data.',
'type' => 'varchar',
'length' => 150,
'not null' => TRUE,
'default' => '',
),
'data' => array(
'description' => 'The modules settings data.',
'type' => 'text',
'size' => 'big',
'not null' => TRUE,
),
),
'primary key' => array(
'gam',
),
);
$schema['cache_gallery_assist_data'] = drupal_get_schema_unprocessed('system', 'cache');
$schema['cache_gallery_assist_data']['description'] = 'Cache table for gallery_assist to store pre-rendered queries, results, and display output.';
$schema['cache_gallery_assist_data']['fields']['serialized']['default'] = 1;
return $schema;
}