You are here

function forena_schema in Forena Reports 7.2

Same name and namespace in other branches
  1. 8 forena.install \forena_schema()
  2. 6.2 forena.install \forena_schema()
  3. 6 forena.install \forena_schema()
  4. 7.5 forena.install \forena_schema()
  5. 7 forena.install \forena_schema()
  6. 7.3 forena.install \forena_schema()
  7. 7.4 forena.install \forena_schema()

Implementation of hook_schema

Return value

unknown

File

./forena.install, line 12
Installation api for module

Code

function forena_schema() {

  /*
   * Table to store Reports
   */
  $schema['forena_reports'] = array(
    'fields' => array(
      'report_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'language' => array(
        'type' => 'varchar',
        'length' => 30,
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 63,
        'not null' => TRUE,
      ),
      'descriptor' => array(
        'type' => 'text',
      ),
      'category' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'hidden' => array(
        'type' => 'int',
        'not null' => FALSE,
      ),
      'cache' => array(
        'type' => 'text',
      ),
      'src' => array(
        'type' => 'text',
      ),
      'modified' => array(
        'type' => 'int',
      ),
      'altered' => array(
        'type' => 'int',
      ),
    ),
    'primary key' => array(
      'report_name',
      'language',
    ),
    'indexes' => array(
      'category' => array(
        'category',
      ),
    ),
  );
  $schema['forena_repositories'] = array(
    'fields' => array(
      'repository' => array(
        'type' => 'varchar',
        'length' => '63',
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => '63',
      ),
      'enabled' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
      'config' => array(
        'type' => 'text',
      ),
    ),
    'primary_key' => array(
      'repository',
    ),
  );
  $schema['forena_data_blocks'] = array(
    'fields' => array(
      'repository' => array(
        'type' => 'varchar',
        'length' => '63',
        'not null' => TRUE,
      ),
      'block_name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 63,
        'not null' => FALSE,
      ),
      'descriptor' => array(
        'type' => 'varchar',
        'length' => '255',
      ),
      'category' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'modified' => array(
        'type' => 'int',
      ),
      'src' => array(
        'type' => 'text',
      ),
      'locked' => array(
        'type' => 'int',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'block_name',
    ),
    'indexes' => array(
      'category' => array(
        'category',
      ),
      'repository' => array(
        'repository',
      ),
    ),
  );
  return $schema;
}