| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 | 
							- <?php
 
- // $Id$
 
- /**
 
-  * @file
 
-  * This file contains all the functions which describe and implement drupal database tables
 
-  * needed by this module. This module was developed by Chad N.A. Krilow and Lacey-Anne Sanderson, 
 
-  * University of Saskatchewan. 
 
-  *
 
-  * The GBrowse manamgenet module allows you to sync data in a chado/Tripal instance with
 
-  * multiple GBrowse/mysql instances as well as manage and create such GBrowse instances
 
-  */
 
- /**
 
-  * Implementation of hook_install()
 
-  */
 
- function tripal_gbrowse_install() {
 
- 	drupal_install_schema('tripal_gbrowse');
 
- }
 
- function tripal_gbrowse_update_2 (&$sandbox) {
 
- 	$ret = array();
 
- 	
 
-   db_add_field($ret, 'tripal_gbrowse_instances', 'nid', array('type' => 'int','unsigned' => FALSE, 'not null' => TRUE));
 
-   
 
-   db_add_field($ret, 'tripal_gbrowse_instances', 'vid', array('type' => 'int','unsigned' => FALSE, 'not null' => TRUE));
 
-   
 
-   return $ret;
 
- }
 
- /**
 
-  * Implementation of hook_uninstall() 
 
-  */
 
- function tripal_gbrowse_uninstall() {
 
- 	drupal_uninstall_schema('tripal_gbrowse');
 
- }
 
- /**
 
-  * Implementation of hook_schema()
 
-  */
 
- function tripal_gbrowse_schema() {
 
- 	//specification for 'tripal_gbrowse_instances'
 
- 	$schema['tripal_gbrowse_instances'] = array(
 
- 		
 
- 		'fields' => array(
 
- 			//a int field that cannot be null and acts as a unique identifier for all nid's
 
-       'nid' => array(
 
- 				'type' => 'int',
 
- 				'unsigned' => FALSE,
 
- 				'not null' => TRUE,
 
-  	 	  ),
 
- 		
 
- 	    //a int field that cannot be null and is vid 	  
 
-   		'vid' => array(
 
-    	   	'type' => 'int',
 
-    	   	'unsigned' => FALSE,
 
-    	   	'not null' => TRUE,
 
-   	  ),
 
- 			
 
- 	    //a serial field that cannot be null and acts as a unique identifier for all gbrowse instances
 
-       'gbrowse_id' => array(
 
- 				'type' => 'serial',
 
- 				'unsigned' => TRUE,
 
- 				'not null' => TRUE,
 
-  	 	  ),
 
- 		
 
- 	    //a varchar field that cannot be null and is the name of a gbrowse instance  	  
 
-   		'database_name' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-   	  ),
 
-    	 	
 
-       //a varchar field, not null and is name of a mysql user that has insert and select permissions on the database
 
-     	 'database_user' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-     	),
 
-     	 	
 
- 	    //user_password: a varchar field that is the password for the above user 	
 
-     	'user_password' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-     	),
 
-     	
 
-       //name: a varchar which is a human-readable name for the gbrowse instance    	
 
-     	'gbrowse_name' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-     	),
 
-     	
 
-     	
 
-       //link: a varchar which is the link to the gbrowse instance    	
 
-     	'gbrowse_link' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-     	),
 
-     	
 
-     	
 
-       //config_file: fully qualified location to the gbrowse configuration file    	
 
-     	'config_file' => array(
 
-    	   	'type' => 'varchar',
 
-    	   	'not null' => TRUE,
 
-     	),
 
-   	  	
 
-     ),//end of shema
 
-   	
 
-   	'primary key' => array('gbrowse_id'),
 
- 	
 
- 	);
 
-   return $schema;
 
- }
 
 
  |