mview_id); } } // Get the list of nodes to remove $sql_lib_id = "SELECT nid, vid ". "FROM {node} ". "WHERE type='chado_library'"; $result = db_query($sql_lib_id); while ($node = db_fetch_object($result)) { node_delete($node->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_library */ function tripal_library_get_schemas (){ $schema = array(); $schema['chado_library'] = 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 ), 'library_id' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0 ) ), 'indexes' => array( 'library_id' => array('library_id') ), 'unique keys' => array( 'nid_vid' => array('nid','vid'), 'vid' => array('vid') ), 'primary key' => array('nid'), ); return $schema; } /** * Implementation of hook_requirements(). Make sure 'Tripal Core' is enabled * before installation * * @ingroup tripal_library */ function tripal_library_requirements($phase) { $requirements = array(); if ($phase == 'install') { if (!function_exists('tripal_create_moddir')) { $requirements ['tripal_library'] = array( 'title' => "tripal_library", 'value' => "error. Some required modules are just being installed. Please try again.", 'severity' => REQUIREMENT_ERROR, ); } } return $requirements; }