Evolve icon indicating copy to clipboard operation
Evolve copied to clipboard

Add a `Drop` command to Evolve.

Open Meigs2 opened this issue 2 years ago • 2 comments

Add Drop command to Evolve

Hi! I'd like to get thoughts on adding a Drop command to the Library and CLI tool. Some other database versioning systems like DbUp and Grate let you drop the entire database as a command, usually as part of a build step for running integration tests.

I am using Evolve right now in a project and noticed it does not have this functionality. Currently, I am manually dropping the database in powershell before migrating using a custom CLI tool I wrote for versioning the app that uses Evolve. I feel it would be beneficial to add a Drop command to facilitate integration testing as part of a build step.

If this is something that fits within the scope of the project, let me know and I'll get started working on a PR to add the functionality.

Meigs2 avatar Jun 24 '22 21:06 Meigs2

Updated! I hit enter slightly too early 😅

Meigs2 avatar Jun 24 '22 22:06 Meigs2

Just to add some more detail/clarification here, the Drop command would essentially connect to the cluster, drop the database specified in the connection string, then proceed as if the Migrate was executed. If evolve doesn't already create the database specified in the string before running its migrations, it would CREATE DATABASE and then migrate.

Would Recreate or another command name be more clear?

Meigs2 avatar Jun 25 '22 18:06 Meigs2