| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 | <?phpfunction tripal_views_setup_schema(){	$schema = array();	$schema['tripal_views_setup'] = array(		'description' => 'contains the setupes, their materialized view id and base table name that was used.',		'fields' => array(			'setup_id' => array(				'description' => 'the id of the setup',				'type' => 'serial',				'unsigned' => TRUE,				'not null' => TRUE,			),			'mview_id' => array(				'description' => 'the materialized view used for this setup',				'type' => 'int',				'unsigned' => TRUE,			),			'base_table_name' => array(				'description' => 'the base table name to be used when using this setup',				'type' => 'varchar',				'length' => 255,				'not null' => TRUE,				'default' => '',			),			'name' => array(				'description' => 'Human readable name of this setup',				'type' => 'varchar',				'length' => 255,				'not null' => TRUE,				'default' => '',			),			'description' => array(				'description' => 'description of this row',				'type' => 'varchar',				'length' => 255,				'not null' => TRUE,				'default' => '',			),		),		'unique_keys' => array(			'setup_id' => array('setup_id'),		),		'primary key' => array('setup_id'),	);	$schema['tripal_mviews_join'] = array(		'description' => 'which materialzed views and chado tables to join in a given setup',		'fields' => array(			'setup_id' => array(				'description' => 'tripal setup id from tripal_views_setup table',				'type' => 'serial',				'unsigned' => TRUE,				'not null'=> TRUE,			),			'view_column' => array(				'description' => 'materialized view name and column',				'type' => 'varchar',				'length' => '255',				'not null' => TRUE,				'default' => '',			),			'chado_column' => array(				'description' => 'which chado table and column is to be linked up to materialized view in this serach',				'type' => 'varchar',				'length' => '255',				'not null' => TRUE,				'default' => '',			),		),		'unique_keys' => array(			'setup_id' => array('setup_id'),		),		'primary key' => array('setup_id'),	);	$schema['tripal_views_handlers'] = array(		'description' => 'in formation for views: column and views handler name',		'fields' => array(			'setup_id' => array(				'description' => 'which setup this is used by from tripal_views_setup table',					'type' => 'serial',					'unsigned' => TRUE,					'not null'=> TRUE,			),			'column_name' => array(				'description' => '',				'type' => 'varchar',				'length' => '255',				'not null' => TRUE,				'default' => '',			),			'handler_name' => array(				'description' => 'name of the views handler to be used for this particular setup',				'type' => 'varchar',				'length' => '255',				'not null' => TRUE,				'default' => '',			),		), 	);	return $schema;}function tripal_views_setup_install(){	drupal_install_schema('tripal_views_setup');}function tripal_views_setup_uninstall(){	drupal_uninstall_schema('tripal_views_setup');}/* * NOTE: when updating schema for this module's tables * follow api of schema module, otherwise on uninstall * the tables will not be removed correctly * */
 |