function tripal_cv_update_7202

2.x tripal_cv.install tripal_cv_update_7202()

Changes the URLs for OBOs.

File

tripal_cv/tripal_cv.install, line 328
Contains functions executed only on install/uninstall of this module

Code

function tripal_cv_update_7202() {
  // Make sure we have the full API loaded this will help during a
  // site upgrade when the tripal_core module is disabled.
  module_load_include('module', 'tripal_core', 'tripal_core');
  tripal_core_import_api();

  // add in the new tripal_cv_defaults table
  try {

    // Convert the OBO's to their appropriate PURL link
    db_update('tripal_cv_obo')
      ->fields(array(
        'path' => 'http://purl.obolibrary.org/obo/so.obo',
      ))
      ->condition('name', 'Sequence Ontology')
      ->execute();

    db_update('tripal_cv_obo')
      ->fields(array(
        'path' => 'http://purl.obolibrary.org/obo/go.obo',
      ))
      ->condition('name', 'Gene Ontology')
      ->execute();

    db_update('tripal_cv_obo')
      ->fields(array(
        'name' => 'Relationship Ontology (legacy)',
        'path' => '{tripal_cv}/files/legacy_ro.obo',
      ))
      ->condition('name', 'Relationship Ontology')
      ->execute();
  }
  catch (\PDOException $e) {
    $error = $e->getMessage();
    throw new DrupalUpdateException('Failed to create tripal_cv_defaults table: ' . $error);
  }
}