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

Checking performed migrations #195

Open
tuomohopia opened this issue Mar 7, 2020 · 2 comments
Open

Checking performed migrations #195

tuomohopia opened this issue Mar 7, 2020 · 2 comments

Comments

@tuomohopia
Copy link
Contributor

tuomohopia commented Mar 7, 2020

Is there any convenient way to check which migrations are have been run and which have not?

I'd like to always have my app confirm that all the expected migrations exist in Postgres before booting up the server. Including the initial setup (Definition).

As far as I can tell, defaultMain features most of of the functionality needed for this. Is it possible to expose that functionality from the Migration module?

Ideally, I'd like to get a list of up/down migrations to compare against. Something like

main = do
    (initial, up, down) <- checkMigrations connStr migrations
   -- Validate & crash if not correct
   -- Start server
@echatav
Copy link
Contributor

echatav commented Mar 9, 2020

I'm open to a PR for this, although migrations have gone thru a bit of change in the dev branch.

@tuomohopia
Copy link
Contributor Author

Got it, I'll figure out something on my own first and then see if it's good enough to be integrated when current dev changes are released as a part of a new version.

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

No branches or pull requests

2 participants