You are here

function lingotek_extend_metadata_tables in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.install \lingotek_extend_metadata_tables()
  2. 7.5 lingotek.install \lingotek_extend_metadata_tables()
9 calls to lingotek_extend_metadata_tables()
lingotek_update_7404 in ./lingotek.install
Upgrade the callback URL signature and adds translation profiles.
lingotek_update_7408 in ./lingotek.install
Creates an upgrade path for existing translated content to be inserted into entity_translation module table if necessary
lingotek_update_7500 in ./lingotek.install
Adds support for translating additional entity types
lingotek_update_7501 in ./lingotek.install
Updates 'lingotek_account_plan_type' to be 'advanced' when 'enterprise'
lingotek_update_7502 in ./lingotek.install
Migrates comment profile settings

... See full list

File

./lingotek.install, line 279

Code

function lingotek_extend_metadata_tables() {
  $tables = array(
    'lingotek_entity_metadata',
    'lingotek_config_metadata',
  );
  $fields = array(
    'created',
    'modified',
  );
  $spec = array(
    'created' => array(
      'type' => 'int',
      'description' => "created timestamp",
      'default' => 0,
      'not null' => TRUE,
    ),
    'modified' => array(
      'type' => 'int',
      'description' => "last modified timestamp",
      'default' => 0,
      'not null' => TRUE,
    ),
  );
  foreach ($tables as $table) {
    foreach ($fields as $field) {
      try {
        db_add_field($table, $field, $spec[$field]);
      } catch (Exception $ex) {

        // already exists (no need to do anything)
      }
    }
  }
}