You are here

function globallink_schema in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink.install \globallink_schema()
  2. 7.6 globallink.install \globallink_schema()

Implements hook_schema().

File

./globallink.install, line 11
Installation file for GlobalLink module.

Code

function globallink_schema() {
  $schema = array();
  $schema['globallink_submission'] = array(
    'description' => 'GlobalLink Submission Table',
    'fields' => array(
      'rid' => array(
        'description' => 'The row id',
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => FALSE,
      ),
      'submission' => array(
        'description' => 'The submission name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'pd_submission_id' => array(
        'description' => 'The PD submission ID',
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'submission_ticket' => array(
        'description' => 'The submission ticket',
        'type' => 'varchar',
        'length' => 45,
        'not null' => TRUE,
      ),
      'source_lang_code' => array(
        'description' => 'The source language code',
        'type' => 'varchar',
        'length' => 5,
        'not null' => TRUE,
      ),
      'source_lang_name' => array(
        'description' => 'The source language name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'sub_target_lang_code' => array(
        'description' => 'The submission target language code',
        'type' => 'varchar',
        'length' => 5,
        'not null' => TRUE,
      ),
      'sub_target_lang_name' => array(
        'description' => 'The submission target language name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'project_code' => array(
        'description' => 'The project code',
        'type' => 'varchar',
        'length' => 45,
        'not null' => TRUE,
      ),
      'project_name' => array(
        'description' => 'The project name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'due_date' => array(
        'description' => 'The due date for the submission',
        'type' => 'varchar',
        'length' => 50,
        'not null' => FALSE,
      ),
      'status' => array(
        'description' => 'The status of submission',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'created' => array(
        'description' => 'The created date',
        'type' => 'int',
        'length' => 11,
        'not null' => FALSE,
      ),
      'updated' => array(
        'description' => 'The updated date',
        'type' => 'int',
        'length' => 11,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
    'indexes' => array(
      'status' => array(
        'status',
      ),
    ),
  );
  $schema['globallink_document'] = array(
    'description' => 'Globallink Document Table',
    'fields' => array(
      'rid' => array(
        'description' => 'The row id',
        'type' => 'serial',
        'unsigned' => FALSE,
        'not null' => TRUE,
      ),
      'submission_rid' => array(
        'description' => 'The submission id as foreign key',
        'type' => 'int',
        'length' => 11,
        'not null' => TRUE,
      ),
      'document_ticket' => array(
        'description' => 'The document ticket',
        'type' => 'varchar',
        'length' => 50,
        'not null' => FALSE,
        'default' => '',
      ),
      'entity_type' => array(
        'description' => 'The entity type',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'entity_type_name' => array(
        'description' => 'The entity type display name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'object_type' => array(
        'description' => 'the object type',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'object_type_name' => array(
        'description' => 'the object type display name',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'object_id' => array(
        'description' => 'The object ID',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'object_parent_id' => array(
        'description' => 'The object parent ID',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'object_version_id' => array(
        'description' => 'The object version ID',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'object_title' => array(
        'description' => 'The object title',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'target_lang_code' => array(
        'description' => 'The target langauge code',
        'type' => 'varchar',
        'length' => 5,
        'not null' => FALSE,
      ),
      'target_status' => array(
        'description' => 'The target status',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'target_ticket' => array(
        'description' => 'The target ticket',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'target_last_sent' => array(
        'description' => 'Target was sent last',
        'type' => 'int',
        'length' => 11,
        'not null' => FALSE,
      ),
      'target_last_updated' => array(
        'description' => 'Target last updated',
        'type' => 'int',
        'length' => 11,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
    'indexes' => array(
      'submission_rid' => array(
        'submission_rid',
      ),
      'entity_type' => array(
        'entity_type',
      ),
      'target_status' => array(
        'target_status',
      ),
    ),
  );
  $schema['globallink_core'] = array(
    'description' => 'GlobalLink Core Table for Node and Entity Change Detection',
    'fields' => array(
      'rid' => array(
        'description' => 'The row ID',
        'type' => 'serial',
        'unsigned' => FALSE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'The node id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'vid' => array(
        'description' => 'The current {node_revisions}.vid version identifier.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'source' => array(
        'description' => 'The origin language of the requested translation',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
      ),
      'target' => array(
        'description' => 'The target language of the requested translation',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
      ),
      'last_modified' => array(
        'description' => 'Last Modified Date for Source Node',
        'type' => 'int',
        'length' => 14,
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'changed' => array(
        'description' => 'Boolean Flag indicating whether source node has changed',
        'type' => 'int',
        'length' => 1,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'rid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  );
  $schema['globallink_locale'] = array(
    'description' => 'GlobalLink Locale Table',
    'fields' => array(
      'locale_code' => array(
        'description' => 'ISO locale code',
        'type' => 'varchar',
        'length' => 10,
        'not null' => TRUE,
      ),
      'locale_desc' => array(
        'description' => 'ISO locale description',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ),
      'drupal_locale_code' => array(
        'description' => 'Drupal locale code',
        'type' => 'varchar',
        'length' => 10,
        'not null' => FALSE,
      ),
      'drupal_locale_desc' => array(
        'description' => 'Drupal locale description',
        'type' => 'varchar',
        'length' => 50,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'locale_code',
    ),
    'indexes' => array(
      'drupal_locale_code' => array(
        'drupal_locale_code',
      ),
    ),
  );
  $schema['globallink_field_config'] = array(
    'description' => 'GlobalLink Field Configuration Table',
    'fields' => array(
      'fid' => array(
        'description' => 'The row ID',
        'type' => 'serial',
        'unsigned' => FALSE,
        'not null' => TRUE,
      ),
      'content_type' => array(
        'description' => 'The content type for the field',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'entity_type' => array(
        'description' => 'The entity type for the field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'bundle' => array(
        'description' => 'The node type for this field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'field_name' => array(
        'description' => 'The field_name for this field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'field_type' => array(
        'description' => 'The field_type for this field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'field_label' => array(
        'description' => 'The field_label for this field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'field_format' => array(
        'description' => 'The field_format for this field',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'translatable' => array(
        'description' => 'Is this field translatable?',
        'type' => 'int',
        'length' => 1,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
    'indexes' => array(
      'field_name' => array(
        'field_name',
      ),
    ),
  );
  return $schema;
}