You are here

function rules_link_schema in Rules Link 7

Same name and namespace in other branches
  1. 7.2 rules_link.install \rules_link_schema()

Implements hook_schema().

File

./rules_link.install, line 11
Install, update and uninstall functions for the rules_link module.

Code

function rules_link_schema() {
  $schema['rules_link'] = array(
    'description' => 'Stores rules links.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique id for the links.',
      ),
      'name' => array(
        'description' => 'The (machine readable) name of the link.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'label' => array(
        'description' => 'The label of the link.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'path' => array(
        'type' => 'text',
        'description' => 'The path for the link.',
      ),
      'entity_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The entity type to which the link should be attached.',
      ),
      'settings' => array(
        'type' => 'blob',
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'Everything else, serialized.',
      ),
      '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,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  return $schema;
}