Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: dry run functionality #89

Open
MatthewBurstein opened this issue Jun 2, 2022 · 2 comments
Open

Feature request: dry run functionality #89

MatthewBurstein opened this issue Jun 2, 2022 · 2 comments

Comments

@MatthewBurstein
Copy link

MatthewBurstein commented Jun 2, 2022

For my CI pipeline, I would like to be able to dry run migrations so that I can show what migrations will run, then request approval from the user, then run them (not withstanding that there might be some change in between). The simplest form of this would be just a boolean config option passed to migrate called dryRun. If true, then instead of running the migrations we would just log a list of the migrations that will be run like the below. I guess ideally the migrations would be validated properly too but this isn's essential for my use case.

It could either output something like this

Migrations to be run:
003-some_migration.sql
004-some_other_migration.sql

or concatenate the file contents and output the actual sql.

I'm happy to raise a PR for this if there is an appetite for it...

@wongjiahau
Copy link

@MatthewBurstein, I have an appetite for it as I have the same use cases as yours.

@ThomWright
Copy link
Owner

Yeah I think that sounds like a pretty sensible idea. Sorry I didn't reply sooner, I don't spend much time on this library anymore.

Happy to take a PR for this which includes tests and docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants