You are here

function migrate_uninstall in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 migrate.install \migrate_uninstall()
  2. 6 migrate.install \migrate_uninstall()

Implements hook_uninstall(). Drop map/message tables, in case implementing classes did not.

File

./migrate.install, line 198
Migrate module installation

Code

function migrate_uninstall() {

  // Note: If a derived Migration class defined its own map or message
  // table name not fitting this pattern, that class is solely responsible for
  // cleaning up
  // TODO: Prefix table names (db_find_tables does not do it)
  foreach (db_find_tables('migrate_map_%') as $tablename) {
    db_drop_table($tablename);
  }
  foreach (db_find_tables('migrate_message_%') as $tablename) {
    db_drop_table($tablename);
  }

  // Remove any file_usage entries we've written
  if (db_table_exists('file_usage')) {
    db_delete('file_usage')
      ->condition('module', 'migrate')
      ->execute();
  }

  // Remove variables
  variable_del('migrate_disable_autoregistration');
  variable_del('migrate_disabled_handlers');
  variable_del('migrate_deprecation_warnings');
}