You are here

function recipe_uninstall in Recipe 7

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

Implements hook_uninstall().

Automatically drops tables in hook_schema.

File

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

Code

function recipe_uninstall() {

  // 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_%',
  ));
}