1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /*******************************************************************************
- * tripal_bulk_loader_install
- */
- function tripal_bulk_loader_install(){
- drupal_install_schema('tripal_bulk_loader');
- }
- /*******************************************************************************
- * tripal_bulk_loader_uninstall
- */
- function tripal_bulk_loader_uninstall(){
- drupal_uninstall_schema('tripal_bulk_loader');
- }
- /**
- * Update
- * Add status, file_has_header columns to tripal_bulk_loader
- */
- function tripal_bulk_loader_update_1 () {
- $update = array();
-
- $update[] = update_sql("ALTER TABLE {tripal_bulk_loader} ADD COLUMN job_status varchar(500) DEFAULT 'initialized'");
- $update[] = update_sql("ALTER TABLE {tripal_bulk_loader} ADD COLUMN file_has_header boolean DEFAULT TRUE");
-
- return $update;
- }
- /**
- * Update
- * Add job_id column to tripal_bulk_loader
- */
- function tripal_bulk_loader_update_2 () {
- $update = array();
-
- $update[] = update_sql("ALTER TABLE {tripal_bulk_loader} ADD COLUMN job_id int");
-
- return $update;
- }
- /*******************************************************************************
- * tripal_bulk_loader_schema
- */
- function tripal_bulk_loader_schema() {
- $schema = array();
- $schema['tripal_bulk_loader'] = array(
- 'fields' => array(
- 'nid' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'loader_name' => array(
- 'type' => 'varchar',
- ),
- 'template_id' => array(
- 'type' => 'varchar',
- ),
- 'file' => array(
- 'type' => 'varchar',
- )
- ),
- 'primary key' => array('nid'),
- 'unique keys' => array(
- 'name' => array('loader_name')
- ),
- );
- $schema['tripal_bulk_loader_template'] = array(
- 'fields' => array(
- 'template_id' => array(
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ),
- 'name' => array(
- 'type' => 'varchar',
- ),
- 'template_array' => array(
- 'type' => 'varchar',
- )
- ),
- 'primary key' => array('template_id'),
- 'unique keys' => array(
- 'name' => array('name')
- ),
- );
- return $schema;
- }
|