Skip to content

Instantly share code, notes, and snippets.

@geerlingguy
Last active October 3, 2016 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geerlingguy/66b19e5e5450f069abe992d5e804842e to your computer and use it in GitHub Desktop.
Save geerlingguy/66b19e5e5450f069abe992d5e804842e to your computer and use it in GitHub Desktop.
Example of hook_uninstall() for migration-related module.
<?php
/**
* @file
* Pix migration install file.
*/
/**
* Implements hook_uninstall().
*/
function pix_migrate_uninstall() {
// Delete this module's migrations.
$migrations = [
'pix_file',
'pix_gallery',
'pix_image',
'pix_name',
'pix_user',
];
foreach ($migrations as $migration) {
Drupal::configFactory()->getEditable('migrate_plus.migration.' . $migration)->delete();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment