function tripal_chado_update_7300

3.x tripal_chado.install tripal_chado_update_7300()

Fixes the phase on the tripal_gffcds_temp table used for importing GFF files, and fixes the db.name term mapping.

File

tripal_chado/tripal_chado.install, line 694

Code

function tripal_chado_update_7300() {
  try {
    if (chado_table_exists('tripal_gffcds_temp')) {
      chado_query("ALTER TABLE {tripal_gffcds_temp} ALTER COLUMN phase DROP NOT NULL;");
    }

    $term = chado_insert_cvterm(array(
      'id' => 'data:1048',
      'name' => 'Database ID',
      'cv_name' => 'EDAM',
      'definition' => 'An identifier of a biological or bioinformatics database.',
    ));
    chado_associate_semweb_term('db', 'name', $term);
  }
  catch (\PDOException $e) {
    $error = $e->getMessage();
    throw new DrupalUpdateException('Could not fix phase on tripal_gffcds_temp table: ' . $error);
  }
}