You are here

function subscriptions_uninstall in Subscriptions 5.2

Same name and namespace in other branches
  1. 6 subscriptions.install \subscriptions_uninstall()
  2. 7 subscriptions.install \subscriptions_uninstall()

Implementation of hook_uninstall().

File

./subscriptions.install, line 133

Code

function subscriptions_uninstall() {
  if (db_table_exists('subscriptions')) {
    db_query("DROP TABLE {subscriptions}");
  }
  if (db_table_exists('subscriptions_old')) {
    db_query("DROP TABLE {subscriptions_old}");

    // old backup from 5.x-1.x
  }
  if (db_table_exists('subscriptions_holding')) {
    db_query("DROP TABLE {subscriptions_holding}");

    // old left-over from 5.x-1.x
  }
  if (db_table_exists('subscriptions_holding_old')) {
    db_query("DROP TABLE {subscriptions_holding_old}");

    // old backup from 5.x-1.x
  }
  if (db_table_exists('subscriptions_queue')) {
    db_query("DROP TABLE {subscriptions_queue}");
  }
  if (db_table_exists('subscriptions_sent')) {

    // old left-over from first
    db_query("DROP TABLE {subscriptions_sent}");

    // incarnation of 5.x-2.0
  }
  if (db_table_exists('subscriptions_mail_edit')) {
    db_query("DROP TABLE {subscriptions_mail_edit}");
  }
  db_query("DELETE FROM {mail_edit} WHERE mailkey LIKE 'subscriptions-%'");
  if (db_table_exists('subscriptions_user')) {
    db_query("DROP TABLE {subscriptions_user}");
  }
  variable_del('subscriptions_avoid_empty_subscribe_links');
  variable_del('subscriptions_blocked_content_types');
  variable_del('subscriptions_blocked_nodes');
  variable_del('subscriptions_cron_percent');
  variable_del('subscriptions_form_expanded');
  variable_del('subscriptions_form_in_block');
  variable_del('subscriptions_form_link_only');
  variable_del('subscriptions_generate_full_node');
  variable_del('subscriptions_link_teaser');
  variable_del('subscriptions_omitted_taxa');
  variable_del('subscriptions_restricted_taxa');
  variable_del('subscriptions_send_intervals');
  variable_del('subscriptions_show_by_author_options');
  variable_del('subscriptions_static_content_types');
  variable_del('subscriptions_unlisted_content_types');

  // also remove legacy 5.x-1.9(-dev) variables:
  variable_del('subscriptions_allow_vid');
  variable_del('subscriptions_autoset');
  variable_del('subscriptions_email_body');
  variable_del('subscriptions_email_subject');
  variable_del('subscriptions_sendself');
  variable_del('subscriptions_teaser');
  variable_del('subscriptions_testpost');
  variable_del('subscriptions_usecron');
  variable_del('subscriptions_usersmenu');
}