- 🇳🇿New Zealand quietone
The patch still applies.
I am setting to Needs Review and noting that @benjifisher commented in #44 ✨ Provide a way to remove migration tables (ID map etc.) Needs work that he was going to add some more suggestions. Still, others can add reviews if they wish.
For those who do migrations via Drush, adding a Drush command to remove a migration table might be helpful. Otherwise, it is always possible to execute a DROP TABLE command in SQL via Drush.
- 🇮🇳India bhanu951
For anyone who want to drop all migrate tables in one go, here is a command to do it
drush sqlq --extra='-ss' "show tables like 'migrate_%'" | sed -r '/^\s*$/d' | while read TABLE ; do echo "drush sqlq 'DROP TABLE $TABLE;'" ; done
credits to @xurizaemon on slack
This command is dangerous and use it only if you know what you are doing. IT WILL DROP ALL MIGRATE TABLES.
- last update
about 1 year ago 30,370 pass - Status changed to Needs work
about 1 year ago 2:23pm 28 September 2023 - 🇺🇸United States mikelutz Michigan, USA
Moving this back to NW, as it definitely needs some work. I'm also not sold on putting this in the migrate module. I feel like for core, We should add an option in migrate drupal UI to remove tables when done. We might also add a drush command to the core migrate drush commands to remove the tables. As far as a UX like this to remove all migration tables, I think it should live in migrate_tools. I'm hesitant to add any UX to the api module directly, I'm a fan of keeping that purely api. Outside of the migrate_drupal_ui, the migrate api requires migrations to be run through drush, migrate_tools UX, or custom code, and I feel like those are the places where table removal should happen. The api module should only provide an api method of removing the tables, which it does through MigrateIdMapInterface::destroy()