Replies: 1 comment 5 replies
-
FYI (and definitely not a recommendation), here is how |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here is a summary of some of the options for managing database migrations.
Haskell Frameworks
persistent-migration
Manual migrations for the
persistent
library. Allows manual migrations that are not possible with the built-in migrations offered bypersistent
.Benefits:
Drawbacks:
persistent
, which has a number of its own drawbacks (use of TH is a big drawback)beam migration framework
The migrations framework from the
beam
ecosystem.Benefits
persistent-migration
Drawbacks
beam
Groundhog
A Haskell ORM-like framework that supports migrations
Benefits
Drawbacks
groundhog
, which is like a less-popularpersistent
that doesn't support joins...External Tools
Sqitch
A CLI tool for managing database migrations using SQL scripts. Uses a git-like interface for managing migrations. https://sqitch.org/docs/manual/sqitchtutorial/
Benefits
Drawbacks
Flyway
A relatively simple CLI tool for managing database migrations using SQL scripts.
Benefits
Drawbacks
Liquibase
A powerful tool for managing database migrations using a changelog file
Benefits
Drawbacks
What Do I Recommend?
I think we really should go with an external tool for managing migrations and schema changes. The Haskell ecosystem unfortunately does not offer a solution that comes even close to the maturity of these solutions. They are all tied to a framework that we may not want to use (persistent, groundhog), lacking documentation (beam), or lacking in functionality and flexibility (all of the above).
I am personally leaning towards
sqitch
, as it has the best documentation, a robust workflow that lends its self well to automation, and useful features like rollbacks, dependency specification, verification, and migration rebasing. Plus, you get to write migrations in plain SQL.Beta Was this translation helpful? Give feedback.
All reactions