You are here

function clientside_validation_schema in Clientside Validation 7.2

Same name and namespace in other branches
  1. 7 clientside_validation.install \clientside_validation_schema()

Implements hook_schema().

File

./clientside_validation.install, line 27

Code

function clientside_validation_schema() {
  $schema = array();
  $schema['clientside_validation_settings'] = array(
    'description' => 'Table for storing Clientside Validation Settings',
    'fields' => array(
      'cvsid' => array(
        'description' => 'The primary identifier for the clientside validation settings',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The type of setting: content_type, webform or custom',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'The status for this form. 1 for enabled (validate), 0 for disabled (don\'t validate)',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
      ),
      'form_id' => array(
        'description' => 'The form id these settings apply to',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'big',
        'translatable' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'indexes' => array(
      'clientside_validation_settings_form_id' => array(
        'form_id',
      ),
      'clientside_validation_settings_type' => array(
        'type',
      ),
      'clientside_validation_settings_form_id_type' => array(
        'form_id',
        'type',
      ),
    ),
    'unique keys' => array(
      'cvs_form_id' => array(
        'form_id',
      ),
    ),
    'primary key' => array(
      'cvsid',
    ),
  );
  return $schema;
}