You are here

function tmgmt_update_7002 in Translation Management Tool 7

Add counter columns to {tmgmt_job_item}.

File

./tmgmt.install, line 453
Installation hooks for the Translation Management module.

Code

function tmgmt_update_7002() {

  // Defining schema of additional fields.
  $schema = array(
    'count_pending' => array(
      'description' => 'Counter for all pending 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_approved' => array(
      'description' => 'Counter for all approved data items.',
      'type' => 'int',
      'not null' => TRUE,
      'default' => 0,
    ),
  );

  // Add aditional fields to db.
  foreach ($schema as $field => $spec) {
    db_add_field('tmgmt_job_item', $field, $spec);
  }
}