You are here

function redhen_relation_schema in RedHen CRM 7

Implements hook_schema().

File

modules/redhen_relation/redhen_relation.install, line 11
Install, update and uninstall functions for the redhen relations module.

Code

function redhen_relation_schema() {
  $schema['redhen_relation_role'] = array(
    'description' => 'RedHen Relation Role.',
    'fields' => array(
      'redhen_relation_role_id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The redhen relation role ID.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'description' => 'The machine name of the redhen relation role.',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'description' => 'The human readable name of the redhen relation role.',
      ),
      'permissions' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of permissions.',
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        // Set the default to ENTITY_CUSTOM without using the constant as it is
        // not safe to use it at this point.
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
    ),
    'indexes' => array(
      'redhen_relation_role_name' => array(
        'name',
      ),
    ),
    'primary key' => array(
      'redhen_relation_role_id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}