function tripal_chado_add_contactprop_table

3.x tripal_chado.chado_v1.2.inc tripal_chado_add_contactprop_table()

Add any custom tables needed by this module.

  • Contactprop: keep track of properties of contact

Related topics

1 call to tripal_chado_add_contactprop_table()
tripal_chado_add_v1_2_custom_tables in tripal_chado/includes/setup/tripal_chado.setup.inc
For Chado v1.2 Tripal provides some new custom tables.

File

tripal_chado/includes/setup/tripal_chado.chado_v1.2.inc, line 8

Code

function tripal_chado_add_contactprop_table() {
  $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',
        ),
      ),
    ),
  );
  chado_create_custom_table('contactprop', $schema, TRUE, NULL, FALSE);
}