nid); } } /** * 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. * * @ingroup tripal_feature */ function tripal_feature_get_schemas($table = NULL) { $schema = array(); if (!$table or strcmp($table, 'chado_feature')==0) { $schema['chado_feature'] = array( 'fields' => array( 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'feature_id' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'sync_date' => array('type' => 'int', 'not null' => FALSE, 'description' => 'UNIX integer sync date/time'), ), 'indexes' => array( 'feature_id' => array('feature_id') ), 'unique keys' => array( 'nid_vid' => array('nid', 'vid'), 'vid' => array('vid') ), 'primary key' => array('nid'), ); } return $schema; }; /** * Implementation of hook_requirements(). */ function tripal_feature_requirements($phase) { $requirements = array(); if ($phase == 'install') { // make sure chado is installed if (!tripal_core_is_chado_installed()) { $requirements ['tripal_feature'] = array( 'title' => "tripal_feature", 'value' => "ERROR: Chado most be installed before this module can be enabled", 'severity' => REQUIREMENT_ERROR, ); } } return $requirements; }