Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $schema = $cached->data;
- <?php
- // $Id: my_module.install,v 1.00.0.1 2012/10/21 00:23:32 Exp $
- /**
- * Implementation of hook_schema().
- */
- function my_module_schema() {
- $schema = array();
- $schema['my_module_pending_inserts'] = array(
- 'fields' => array(
- 'id' => array(
- 'description' => 'primary key',
- 'type' => 'serial',
- 'size' => 'tiny',
- 'not null' => TRUE,
- ),
- 'json_array_data' => array(
- 'type' => 'text',
- 'not null' => TRUE,
- ),
- 'successfully_run' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'date_created' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'date_updated' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- )
- ),
- 'primary key' => array('id'),
- );
- return $schema;
- }
- function jira_reporting_install() {
- // Create tables.
- drupal_install_schema('my_module_pending_inserts');
- }
- function my_module_uninstall() {
- // Remove tables.
- drupal_uninstall_schema('my_module_pending_inserts');
- // Delete variables
- variable_del('my_module_variable1');
- variable_del('my_module_variable2');
- variable_del('my_module_variable3');
- }
- function my_module_update_2() {
- $up = array();
- $tbl = array(
- 'fields' => array(
- 'id' => array(
- 'type' => 'serial', 'not null' => TRUE
- ),
- 'json_array_data' => array(
- 'type' => 'varchar',
- 'length' => 250,
- 'not null' => True
- ),
- 'successfully_run' => array(
- 'type' => 'int'
- ),
- 'date_created' => array(
- 'type' => 'int'
- ),
- 'date_updated' => array(
- 'type' => 'int'
- ),
- ),
- 'primary key' => array('id'),
- );
- db_create_table(&$up, 'my_module_pending_inserts', $tbl);
- return $up;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement