nid); } } /******************************************************************************* * Implementation of hook_schema() creates two tables. chado_analysis table * stores nodes that are also saved in the analysis table of chado database. * tripal_analysis table stores the sub-module names, such as * tripal_analysis_blast, that are registered with this module. */ function tripal_analysis_schema() { // chado_analysis table $schema['chado_analysis'] = 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 ), 'analysis_id' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0 ) ), 'indexes' => array( 'analysis_id' => array('analysis_id') ), 'unique keys' => array( 'nid_vid' => array('nid','vid'), 'vid' => array('vid') ), 'primary key' => array('nid'), ); // tripal_analysis table $schema['tripal_analysis'] = array( 'description' => t('Table to store analysis sub-modules'), 'fields' => array( 'modulename' => array( 'type' => 'text', 'size' => 'small', 'not null' => TRUE, 'description' => t('The module name. Tripal Analysis will use the '. 'module name to call module_setting_form()') ) ), 'unique keys' => array( 'modulename' => array('modulename') ) ); return $schema; } /******************************************************************************* * Implementation of hook_requirements(). Make sure 'Tripal Core' is enabled * before installation */ function tripal_analysis_requirements($phase) { $requirements = array(); if ($phase == 'install') { if (!function_exists('tripal_create_moddir')) { $requirements ['tripal_analysis'] = array( 'title' => "tripal_analysis", 'value' => "error. Some required modules are just being installed. Please try again.", 'severity' => REQUIREMENT_ERROR, ); } } return $requirements; }