You are here

function linkit_schema in Linkit 7.2

Same name and namespace in other branches
  1. 7.3 linkit.install \linkit_schema()

Implements hook_schema().

1 call to linkit_schema()
linkit_update_7200 in ./linkit.install
Create the {linkit_profiles} table if it not exists.

File

./linkit.install, line 10
Install, update and uninstall functions for the Linkit module.

Code

function linkit_schema() {
  $schema = array();
  $schema['linkit_profiles'] = array(
    'description' => 'Base table holding Linkit profiles.',
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'pid',
      'identifier' => 'linkit_profile',
      'status' => 'linkit_profiles_status',
      'load callback' => 'linkit_profile_load',
      'load all callback' => 'linkit_profile_load_all',
      'save callback' => 'linkit_profile_save',
      'bulk export' => TRUE,
      'api' => array(
        'owner' => 'linkit',
        'api' => 'linkit_profiles',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'pid' => array(
        'description' => 'Serial id for this profile.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'description' => 'Machine-readable name for this profile.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'admin_title' => array(
        'description' => 'Administrative title for this profile.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'data' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'description' => 'A serialized array with settings.',
      ),
      'role_rids' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'description' => 'A serialized array with role rids that is assign to this profile.',
      ),
      'weight' => array(
        'description' => 'Profile weight.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}