You are here

function slickgrid_schema in Slickgrid 7

Same name and namespace in other branches
  1. 6 slickgrid.install \slickgrid_schema()
  2. 7.2 slickgrid.install \slickgrid_schema()

Implementation of hook_schema().

File

./slickgrid.install, line 39

Code

function slickgrid_schema() {
  $schema['slickgrid'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The users UID.',
      ),
      'view_name' => array(
        'type' => 'varchar',
        'length' => '32',
        'default' => '',
        'not null' => TRUE,
        'description' => 'The unique name of the view. May only be alphanumeric characters plus underscores.',
      ),
      'display_id' => array(
        'type' => 'varchar',
        'length' => '64',
        'default' => '',
        'not null' => TRUE,
        'description' => 'An identifier for this display; usually generated from the display_plugin, so should be something like page or page_1 or block_2, etc.',
      ),
      'settings' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'description' => 'A serialized array of view settings.',
      ),
    ),
    'primary key' => array(
      'uid',
      'view_name',
    ),
    'foreign keys' => array(
      'id' => array(
        'table' => 'views_display',
        'columns' => array(
          'id' => 'display_id',
        ),
      ),
      'name' => array(
        'table' => 'views_view',
        'columns' => array(
          'name' => 'view_name',
        ),
      ),
    ),
  );
  return $schema;
}