You are here

function recipe_uninstall in Recipe 7.2

Same name and namespace in other branches
  1. 5 recipe.install \recipe_uninstall()
  2. 6 recipe.install \recipe_uninstall()
  3. 7 recipe.install \recipe_uninstall()

Implements hook_uninstall().

Automatically drops tables in hook_schema.

File

./recipe.install, line 22
Install, update and uninstall functions for the recipe module.

Code

function recipe_uninstall() {

  // Delete the recipe node fields.
  require_once dirname(__FILE__) . '/includes/recipe.node_type.inc';
  _recipe_uninstall_node_type();

  // remove node revisions
  db_query('DELETE FROM {node_revision} WHERE nid in (select nid from {node} WHERE type = :type)', array(
    ':type' => 'recipe',
  ));

  // remove recipe nodes
  db_query('DELETE FROM {node} WHERE type = :type', array(
    ':type' => 'recipe',
  ));

  // remove variables
  db_query('DELETE FROM {variable} WHERE name like :type', array(
    ':type' => 'recipe_%',
  ));
}