You are here

function tmgmt_local_update_7000 in Translation Management Tool 7

Adds the {tmgmt_local_task_item} table.

File

translators/tmgmt_local/tmgmt_local.install, line 158
Installation hooks for tmgmt_local module.

Code

function tmgmt_local_update_7000() {
  $schema = array(
    'description' => 'A tmgmt local task item contains additional workflow data for a job item.',
    'fields' => array(
      'tltiid' => array(
        'description' => 'The identifier of the task item.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'tltid' => array(
        'description' => 'Translation job task {tmgmt_local_task}.tltid that belongs to task.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'tjiid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'description' => "Translation job item {tmgmt_job_item}.tjiid that belongs to task.",
      ),
      'status' => array(
        'description' => 'The status of the task.',
        'type' => 'int',
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => 'Stores translations and translation statuses',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
      ),
      'count_untranslated' => array(
        'description' => 'Counter for all untranslated data items.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'count_translated' => array(
        'description' => 'Counter for all translated data items.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'count_completed' => array(
        'description' => 'Counter for all completed data items.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'tltiid',
    ),
    'indexes' => array(
      'tltid' => array(
        'tltid',
      ),
    ),
    'foreign keys' => array(
      'task' => array(
        'table' => 'tmgmt_local_task',
        'columns' => array(
          'tltid' => 'tltid',
        ),
      ),
      'job_item' => array(
        'table' => 'tmgmt_job_item',
        'columns' => array(
          'tjiid' => 'tjiid',
        ),
      ),
    ),
  );
  db_create_table('tmgmt_local_task_item', $schema);
}