You are here

function entity_rules_schema in Entity Rules 7

Implements hook_schema().

1 call to entity_rules_schema()
entity_rules_update_7101 in ./entity_rules.install
Add entity_rule_setting table.

File

./entity_rules.install, line 10
Install functions

Code

function entity_rules_schema() {
  $schema = array();
  $schema['entity_rule_setting'] = array(
    'description' => 'Stores about entity rules settings.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique entity rule setting type identifier.',
      ),
      'entity_type' => array(
        'description' => 'Entity type for this setting.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'bundle' => array(
        'description' => 'Bundle for this setting.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'op' => array(
        'description' => 'Operation for this setting.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'rules_config' => array(
        'description' => 'rules config for this setting.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'The weight of this entity rule setting in relation to others.',
      ),
      'args' => array(
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of arguments related to this entity rule setting.',
      ),
      'false_msg' => array(
        'description' => 'Optional false message.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => FALSE,
      ),
    ) + entity_exportable_schema_fields(),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'setting' => array(
        'entity_type',
        'bundle',
        'op',
        'rules_config',
        'weight',
      ),
    ),
  );
  return $schema;
}