You are here

function data_schema in Data 8

Same name and namespace in other branches
  1. 6 data.install \data_schema()
  2. 7 data.install \data_schema()

Implements hook_schema().

File

./data.install, line 10
Install hooks for Data module.

Code

function data_schema() {
  $schema['data_tables'] = array(
    'description' => 'Tables managed by Data module.',
    'export' => array(
      'key' => 'name',
      'identifier' => 'data_table',
      'default hook' => 'data_default',
      // Function hook name.
      'api' => array(
        'owner' => 'data',
        'api' => 'data_default',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'title' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Natural name of the table.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Table name.',
      ),
      'table_schema' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => 'Table schema.',
        'serialize' => TRUE,
      ),
      'meta' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => 'Meta information about the table and its fields.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  return $schema;
}