12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- function tripal_stock_install() {
-
- tripal_create_moddir('tripal_stock');
-
-
- drupal_install_schema('tripal_stock');
- }
- function tripal_stock_uninstall() {
- drupal_uninstall_schema('tripal_stock');
-
- $sql_lib_id = "SELECT nid, vid ".
- "FROM {node} ".
- "WHERE type='chado_stock'";
- $result = db_query($sql_lib_id);
-
- while ($node = db_fetch_object($result)) {
- node_delete($node->nid);
- }
- }
- function tripal_stock_schema() {
- $schema['chado_stock'] = array(
- 'fields' => array(
- 'vid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'nid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'stock_id' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- ),
- 'indexes' => array(
- 'stock_id' => array('stock_id'),
- 'nid' => array('nid'),
- ),
- 'unique' => array(
- 'stock_id' => array('stock_id'),
- ),
- 'primary key' => array('vid'),
- );
- return $schema;
- }
- function tripal_stock_requirements($phase) {
- $requirements = array();
- if ($phase == 'install') {
-
- if (!tripal_core_is_chado_installed()) {
- $requirements ['tripal_stock'] = array(
- 'title' => "tripal_stock",
- 'value' => "ERROR: Chado most be installed before this module can be enabled",
- 'severity' => REQUIREMENT_ERROR,
- );
- }
- }
- return $requirements;
- }
|