function tripal_chado_fix_v1_3_custom_tables

3.x tripal_chado.setup.inc tripal_chado_fix_v1_3_custom_tables()

Many of the custom tables created for Chado v1.2 are now in Chado v1.3.

These tables need not be tracked by Tripal anymore as custom tables and in some cases the Chado version has different columns so we need to adjust them.

2 calls to tripal_chado_fix_v1_3_custom_tables()
tripal_chado_prepare_chado in tripal_chado/includes/setup/tripal_chado.setup.inc
Prepares Chado for use by Tripal.
tripal_chado_update_7303 in tripal_chado/tripal_chado.install
Fixes inconsistency with Chado v1.3 update if was applied.

File

tripal_chado/includes/setup/tripal_chado.setup.inc, line 559
Functions to install chado schema through Drupal

Code

function tripal_chado_fix_v1_3_custom_tables() {


  // Update the featuremap_dbxref table by adding an is_current field.
  if (!chado_column_exists('featuremap_dbxref', 'is_current')) {
    chado_query("ALTER TABLE {featuremap_dbxref} ADD COLUMN is_current boolean DEFAULT true NOT NULL,;");
  }

  // Remove the previously managed custom tables from the
  // tripal_custom_tables table.
  db_delete('tripal_custom_tables')
    ->condition('table_name', array('analysisfeatureprop', 'featuremap_dbxref', 'contactprop', 'featuremapprop', 'featureposprop', 'pubauthor_contact'))
    ->execute();
}