array( 'vid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0 ), 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0 ), 'organism_id' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0 ) ), 'indexes' => array( 'organism_id' => array('organism_id') ), 'unique keys' => array( 'nid_vid' => array('nid', 'vid'), 'vid' => array('vid') ), 'primary key' => array('nid'), ); return $schema; } /** * Implementation of hook_uninstall(). * * @ingroup tripal_organism */ function tripal_organism_uninstall() { // Get the list of nodes to remove $sql_lib_id = " SELECT nid, vid FROM {node} WHERE type='chado_organism' "; $result = db_query($sql_lib_id); foreach ($result as $node) { node_delete($node->nid); } } /** * Implementation of hook_requirements(). * */ function tripal_organism_requirements($phase) { $requirements = array(); if ($phase == 'install') { // make sure chado is installed if (!tripal_core_is_chado_installed()) { $requirements ['tripal_organism'] = array( 'title' => "tripal_organism", 'value' => "ERROR: Chado most be installed before this module can be enabled", 'severity' => REQUIREMENT_ERROR, ); } } return $requirements; }