function tripal_views_update_6040

2.x tripal_views.install tripal_views_update_6040()
1.x tripal_views.install tripal_views_update_6040()

Tripal Views Update for 6.x-0.4

  • Add priority field to tripal_views
  • Add handler field to tripal_views_join
  • Add tripal_views_field table to keep track of fields for views integration

File

tripal_views/tripal_views.install, line 69
Functions related to installing/uninstalling this module

Code

function tripal_views_update_6040() {
  $ret = array();

  // Add Priority to tripal_views
  db_add_field($ret, 'tripal_views', 'priority', array('type' => 'int'));
  db_add_unique_key($ret, 'tripal_views', 'priority', array('table_name', 'priority'));
  db_add_index($ret, 'tripal_views', 'priority', array('table_name', 'priority'));

  // Add handler to tripal_views_join
  db_add_field($ret, 'tripal_views_join', 'handler', array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''));

  // Add tripal_views_field to keep track of fields for views integration
  $schema = tripal_views_views_schema();
  db_create_table($ret, 'tripal_views_field', $schema['tripal_views_field']);

  // Add base_table TRUE/FALSE to tripal_views
  db_add_field($ret, 'tripal_views', 'base_table', array('type' => 'int', 'not null ' => TRUE,
    'default' => 1));

  // Add arguments to joins
  db_add_field(
  $ret, 
  'tripal_views_join', 
  'arguments', 
  array(
    'description' => 'arguments that may get passed to the handler',
    'type' => 'text',
    'size' => 'normal'
  )
  );

  return $ret;
}