function tripal_contact_add_custom_tables

2.x tripal_contact.install tripal_contact_add_custom_tables()
1.x tripal_contact.install tripal_contact_add_custom_tables()
2 calls to tripal_contact_add_custom_tables()
tripal_contact_install in tripal_contact/tripal_contact.install
Implementation of hook_install().
tripal_contact_update_6001 in tripal_contact/tripal_contact.install
Update for Drupal 6.x, Tripal 1.0 This update

File

tripal_contact/tripal_contact.install, line 98
This file contains all the functions which describe and implement drupal database tables needed by this module. This module was developed by Chad N.A. Krilow and Lacey-Anne Sanderson, University of Saskatchewan.

Code

function tripal_contact_add_custom_tables() {
  $schema = array(
    'table' => 'contactprop',
    'fields' => array(
      'contactprop_id' => array(
        'type' => 'serial',
        'not null' => true,
      ),
      'contact_id' => array(
        'type' => 'int',
        'not null' => true,
      ),
      'type_id' => array(
        'type' => 'int',
        'not null' => true,
      ),
      'value' => array(
        'type' => 'text',
        'not null' => false,
      ),
      'rank' => array(
        'type' => 'int',
        'not null' => true,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      0 => 'contactprop_id',
    ),
    'unique keys' => array(
      'contactprop_c1' => array(
        0 => 'contact_id',
        1 => 'type_id',
        2 => 'rank',
      ),
    ),
    'indexes' => array(
      'contactprop_idx1' => array(
        0 => 'contact_id',
      ),
      'contactprop_idx2' => array(
        0 => 'type_id',
      ),
    ),
    'foreign keys' => array(
      'cvterm' => array(
        'table' => 'cvterm',
        'columns' => array(
          'type_id' => 'cvterm_id',
        ),
      ),
      'contact' => array(
        'table' => 'contact',
        'columns' => array(
          'contact_id' => 'contact_id',
        ),
      ),
    ),
  );
  tripal_core_create_custom_table($ret, 'contactprop', $schema, TRUE);
}