You are here

function css_injector_update_7002 in CSS Injector 7

Adds enabled rule and themes list.

File

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

Code

function css_injector_update_7002() {
  $enabled = array(
    'description' => 'Whether the rules should be enabled',
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 1,
  );
  $themes = array(
    'description' => 'Themes that CSS rule will be applied to',
    'type' => 'text',
  );
  if (!db_field_exists('css_injector_rule', 'enabled')) {
    db_add_field('css_injector_rule', 'enabled', $enabled);
  }
  if (!db_field_exists('css_injector_rule', 'rule_themes')) {
    db_add_field('css_injector_rule', 'rule_themes', $themes);
  }
  else {
    db_change_field('css_injector_rule', 'rule_themes', 'rule_themes', array(
      'type' => 'text',
      'not null' => FALSE,
    ));
  }
}