Generate Goose migrations for Postgres using stripe/pg-schema-diff #538
mortenson
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 Hi there - thought I'd share a command I've been trying out to generate Goose migrations for Postgres using this new library: https://github.com/stripe/pg-schema-diff
Basically, it takes the current state of the database and compares it to your
schema
directory, then has pg-schema-diff generate statements by comparing your current database to a temporary one it applied your schema to. Statements that containCONCURRENT
(index creation, probably) are split into their own migration without a transaction.I'll try to keep it updated as I continue using it on my new project, hope it's useful to someone!
https://gist.github.com/mortenson/c3c1e7f2a1b10c5c3674f8c91123c3e0
Beta Was this translation helpful? Give feedback.
All reactions