function tripal_core_schema

2.x tripal_core.install tripal_core_schema()
3.x tripal_core.install tripal_core_schema()
1.x tripal_core.install tripal_core_schema()

Implementation of hook_schema().

Related topics

File

tripal_core/tripal_core.install, line 65
Contains functions used to install/uninstall tripal_core.

Code

function tripal_core_schema() {

  // get the schemas defined by this install file
  $schema = tripal_core_get_schemas();

  // if this module is already installed and enabled, then we want to provide
  // the schemas for all of the custom tables.  This will allow Views to
  // see the schemas.  We check if the module is installed because during
  // installation we don't want to make these custom tables available as we don't
  // want them created in the Drupal database.  The custom tables go in the
  // Chado database.
  if (db_table_exists('tripal_custom_tables')) {
    $sql = 'SELECT * FROM {tripal_custom_tables}';
    $q = db_query($sql);
    while ($custom = db_fetch_object($q)) {
      $schema[$custom->table_name] = unserialize($custom->schema);
    }
  }

  return $schema;
}