function tripal_core_get_custom_tables_schema

2.x tripal_core.install tripal_core_get_custom_tables_schema()

Describes the Tripal Custom Tables (tripal_custom_tables) table This keeps track of tables created by Tripal and stored in chado that may or may not also be materialized views.

Related topics

1 call to tripal_core_get_custom_tables_schema()
tripal_core_get_schemas in tripal_core/tripal_core.install
This function simply defines all tables needed for the module to work correctly. By putting the table definitions in a separate function we can easily provide the entire list for hook_install or individual tables for an update.

File

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

Code

function tripal_core_get_custom_tables_schema() {
  $schema = array();
  $schema['tripal_custom_tables'] = array(
    'fields' => array(
      'table_id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not NULL' => TRUE
      ),
      'table_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not NULL' => TRUE
      ),
      'schema' => array(
        'type' => 'text',
        'not NULL' => TRUE
      ),
      'mview_id' => array(
        'type' => 'int',
        'not NULL' => FALSE
      )
    ),
    'indexes' => array(
      'table_id' => array('table_id'),
    ),
    'primary key' => array('table_id'),
    'foreign keys' => array(
      'tripal_mviews' => array(
        'table' => 'tripal_mviews',
        'columns' => array(
          'mview_id' => 'mview_id'
        ),
      ),
    ),
  );

  return $schema;
}