Skip to content

Instantly share code, notes, and snippets.

@skwashd
Created March 29, 2014 08:19
Show Gist options
  • Save skwashd/9850656 to your computer and use it in GitHub Desktop.
Save skwashd/9850656 to your computer and use it in GitHub Desktop.
Delete old rules that are in the database. Best used in a hook_update_N() implementation.
<?php
$type = 'rules_config';
$query = new EntityFieldQuery();
$rules = $query->entityCondition('entity_type', $type)
->execute();
if (!$rules) {
return;
}
rules_config_delete(array_keys($rules[$type]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment