You are here

function css_injector_schema in CSS Injector 7

Same name and namespace in other branches
  1. 6 css_injector.install \css_injector_schema()
  2. 7.2 css_injector.install \css_injector_schema()

Implements hook_schema().

File

./css_injector.install, line 18
Install, update and uninstall functions for the css_injector module.

Code

function css_injector_schema() {
  $schema['css_injector_rule'] = array(
    'fields' => array(
      'crid' => array(
        'description' => 'The primary identifier for the CSS injection rule',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The descriptive title of the CSS injection rule',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'rule_type' => array(
        'description' => 'The type of rule to use when determining if the CSS should be injected',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'rule_conditions' => array(
        'description' => 'The data to evaluate when determining if the CSS should be injected',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'rule_themes' => array(
        'description' => 'Themes that CSS rule will be applied to',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'media' => array(
        'description' => 'The media type of the CSS file (screen, print, etc.)',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'preprocess' => array(
        'description' => 'Whether the CSS file should be included by the CSS preprocessor',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'enabled' => array(
        'description' => 'Whether the rules should be enabled',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'primary key' => array(
      'crid',
    ),
  );
  return $schema;
}