You are here

function config_perms_schema in Custom Permissions 7.2

Same name and namespace in other branches
  1. 6.2 config_perms.install \config_perms_schema()

Implements hook_schema().

File

./config_perms.install, line 32
Installation file

Code

function config_perms_schema() {
  $schema['config_perms'] = array(
    'description' => 'The config perms table.',
    // Optional CTools export.inc integration
    'export' => array(
      'key' => 'machine_name',
      'identifier' => 'config_perms',
      'default hook' => 'config_perms',
      'api' => array(
        'owner' => 'config_perms',
        'api' => 'config_perms',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'machine_name' => array(
        'description' => 'The primary identifier for a permission',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'pid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'no export' => TRUE,
      ),
      'status' => array(
        'description' => 'Whether this field is enabled or not.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'path' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'machine_name',
      ),
    ),
  );
  return $schema;
}