You are here

function gallery_assist_schema in Gallery Assist 6

Same name and namespace in other branches
  1. 7 gallery_assist.install \gallery_assist_schema()

Implementation of hook_schema().

File

./gallery_assist.install, line 12
Install, update and uninstall functions and DB tables 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 from a gallery.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 2,
      ),
      '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' => 'Show in users galleries block.',
        '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' => 20,
      ),
      '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,
      ),
      'items' => array(
        'description' => 'Amount of images in the gallery.',
        '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,
      ),
      'ref' => array(
        'description' => 'The reference ID to 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,
      ),
      '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',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cover' => array(
        'description' => 'The cover image of this gallery',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'aid' => array(
        'description' => 'The alias (pathauto) identifier',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    '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;
}