function tripal_pub_add_custom_tables

2.x tripal_pub.install tripal_pub_add_custom_tables()
1.x tripal_pub.install tripal_pub_add_custom_tables()

Add custom table related to publications

  • pubauthor_contact

Related topics

1 call to tripal_pub_add_custom_tables()
tripal_pub_install in tripal_pub/tripal_pub.install
Implementation of hook_install().

File

tripal_pub/tripal_pub.install, line 193
Installation of the publication module

Code

function tripal_pub_add_custom_tables() {
  $schema = array(
    'table' => 'pubauthor_contact',
    'fields' => array(
      'pubauthor_contact_id' => array(
        'type' => 'serial',
        'not null' => true,
      ),
      'contact_id' => array(
        'type' => 'int',
        'not null' => true,
      ),
      'pubauthor_id' => array(
        'type' => 'int',
        'not null' => true,
      ),
    ),
    'primary key' => array(
      0 => 'pubauthor_contact_id',
    ),
    'unique keys' => array(
      'pubauthor_contact_c1' => array(
        0 => 'contact_id',
        1 => 'pubauthor_id',
      ),
    ),
    'foreign keys' => array(
      'contact' => array(
        'table' => 'contact',
        'columns' => array(
          'contact_id' => 'contact_id',
        ),
      ),
      'pubauthor' => array(
        'table' => 'pubauthor',
        'columns' => array(
          'pubauthor_id' => 'pubauthor_id',
        ),
      ),
    ),
  );
  chado_create_custom_table('pubauthor_contact', $schema, TRUE);
}