You are here

forena.install in Forena Reports 6

Installation api for module

File

forena.install
View source
<?php

/**
 * @file
 * Installation api for module
 */

/**
 * Implementation of hook_schema
 *
 * @return unknown
 */
function forena_schema() {
  $schema['forena_reports'] = array(
    'fields' => array(
      'report_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 63,
        'not null' => TRUE,
      ),
      'category' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'hidden' => array(
        'type' => 'int',
        'not null' => FALSE,
      ),
      'cache' => array(
        'type' => 'text',
      ),
      'modified' => array(
        'type' => 'int',
      ),
    ),
    'primary key' => array(
      'report_name',
    ),
    'indexes' => array(
      'category' => array(
        'category',
      ),
    ),
  );
  return $schema;
}
function forena_update_6001() {
  $ret = array();
  db_add_field($ret, 'forena_reports', 'modified', array(
    'type' => 'int',
  ));
  return $ret;
}
function forena_update_6002() {
  $ret = array();
  db_drop_field($ret, 'forena_reports', 'file_name');
  return $ret;
}

/**
 * Basic install and uninstall hooks. 
 *
 */
function forena_install() {
  drupal_install_schema('forena');
}
function forena_uninstall() {
  drupal_uninstall_schema('forena');
}

Functions

Namesort descending Description
forena_install Basic install and uninstall hooks.
forena_schema Implementation of hook_schema
forena_uninstall
forena_update_6001
forena_update_6002