array( 'job_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'uid' => array ('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => 'The Drupal userid of the submitee'), 'job_name' => array('type' => 'varchar','length' => 255, 'not null' => TRUE), 'modulename' => array('type' => 'varchar','length' => 50, 'not null' => TRUE, 'description' => 'The module name that provides the callback for this job'), 'callback' => array('type' => 'varchar','length' => 255, 'not null' => TRUE), 'arguments' => array('type' => 'text', 'size' => 'normal', 'not null' => FALSE), 'progress' => array('type' => 'int', 'unsigned' => TRUE, 'default' => 0, 'not null' => FALSE, 'description' => 'a value from 0 to 100 indicating percent complete'), 'status' => array('type' => 'varchar','length' => 50, 'not null' => TRUE), 'submit_date' => array ('type' => 'int', 'not null' => TRUE, 'description' => 'UNIX integer submit time'), 'start_time' => array ('type' => 'int', 'not null' => FALSE, 'description' => 'UNIX integer start time'), 'end_time' => array ('type' => 'int', 'not null' => FALSE, 'description' => 'UNIX integer end time'), 'error_msg' => array('type' => 'text','size' => 'normal', 'not null' => FALSE), 'pid' => array ('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'description' => 'The process id for the job'), 'priority' => array ('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => '0', 'description' => 'The job priority'), 'mlock' => array ('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'description' => 'If set to 1 then all jobs for the module are held until this one finishes'), 'lock' => array ('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'description' => 'If set to 1 then all jobs are held until this one finishes'), ), 'indexes' => array( 'job_id' => array('job_id'), 'job_name' => array('job_name') ), 'primary key' => array('job_id'), ); $schema['tripal_mviews'] = array( 'fields' => array( 'mview_id' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'name' => array('type' => 'varchar','length' => 255, 'not null' => TRUE), 'modulename' => array('type' => 'varchar','length' => 50, 'not null' => TRUE, 'description' => 'The module name that provides the callback for this job'), 'mv_table' => array('type' => 'varchar','length' => 128, 'not null' => TRUE), 'mv_specs' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE), 'indexed' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE), 'query' => array('type' => 'text', 'size' => 'normal', 'not null' => TRUE), 'special_index' => array('type' => 'text', 'size' => 'normal', 'not null' => FALSE), 'last_update' => array ('type' => 'int', 'not null' => FALSE, 'description' => 'UNIX integer time'), ), 'indexes' => array( 'mview_id' => array('mview_id') ), 'unique keys' => array( 'mv_table' => array('mv_table'), 'mv_name' => array('name'), ), 'primary key' => array('mview_id'), ); $schema = tripal_core_views_integration_schema(); return $schema; } /************************************************************************ * * * @ingroup tripal_core */ function tripal_core_views_integration_schema(){ $schema['tripal_views_integration'] = 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, ), 'chado_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( 'mview_join_id' => array( 'description' => 'the id of the join', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'setup_id' => array( 'description' => 'tripal setup id from tripal_views_integration table', 'type' => 'int', 'unsigned' => TRUE, 'not null'=> TRUE, ), 'view_table' => array( 'description' => 'materialized view table name', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), 'view_column' => array( 'description' => 'column of materialized view table (mview_table)', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), 'chado_table_join' => array( 'description' => 'on which chado table to join to materialized view in this serach', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), 'chado_column' => array( 'description' => 'chado table (above) column to join on materialized view in this serach', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), ), 'unique_keys' => array( 'setup_id' => array('mview_join_id'), ), 'primary key' => array('mview_join_id'), ); $schema['tripal_views_handlers'] = array( 'description' => 'in formation for views: column and views handler name', 'fields' => array( 'handler_id' => array( 'description' => 'the id of the handler', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'setup_id' => array( 'description' => 'which setup this is used by from tripal_views_integration table', 'type' => 'int', 'unsigned' => TRUE, 'not null'=> TRUE, ), 'column_name' => array( 'description' => '', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), 'handler_filter' => array( 'description' => 'identifier of the handler filter to be used for this column', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), 'handler_field' => array( 'description' => 'identifier of the handler field to be used for this column', 'type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => '', ), ), 'unique_keys' => array( 'setup_id' => array('handler_id'), ), 'primary key' => array('handler_id'), ); return $schema; } /************************************************************************ * * * @ingroup tripal_core */ function tripal_core_update_6000(){ // recreate the materialized view tripal_feature_add_organism_count_mview(); $ret = array( '#finished' => 1, ); return $ret; } /************************************************************************ * * * @ingroup tripal_core */ tripal_core_update_6000_views_integration(){ } ?>