12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- /**
- * @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 project manamgenet module allows you to sync data in a chado/Tripal instance with
- * multiple project/mysql instances as well as manage and create such project instances
- */
- /**
- * Implementation of hook_install().
- */
- function tripal_pub_install() {
- drupal_install_schema('tripal_pub');
- $dbxref = array('accession' => 'abstract', 'db_id' => array('name' => 'tripal'));
- $success = tripal_core_chado_insert('dbxref', $dbxref);
- if ($success) {
- tripal_core_chado_insert('cvterm', array('name' => 'abstract', 'cv_id' => array('name' => 'tripal'), 'dbxref_id' => $dbxref));
- }
- }
- /**
- * Implementation of hook_uninstall().
- */
- function tripal_pub_uninstall() {
- //Remove tables
- drupal_uninstall_schema('tripal_pub');
- }
- /**
- * Implementation of hook_schema().
- */
- function tripal_pub_schema() {
- //specification for 'tripal_pub_instances'
- $schema['chado_pub'] = 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' => TRUE,
- 'not null' => TRUE,
- ),
- //a int field that cannot be null and is vid
- 'vid' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- //a intfield, not null and project_id is the unique_id of the project in chado
- 'pub_id' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- //a intfield, not null and project_id is the unique_id of the project in chado
- 'pubmed_id' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => FALSE,
- ),
- 'author' => array(
- 'type' => 'text',
- 'size' => 'normal',
- 'not null' => TRUE,
- 'default' => '',
- 'description' => 'The Author Name.',
- ),
- ),
- //end of shema
- 'primary key' => array('nid'),
- );
- return $schema;
- }
|