squeal
squeal copied to clipboard
Checking performed migrations
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
I'm open to a PR for this, although migrations have gone thru a bit of change in the dev branch.
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.