frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

How to Compile Your DB Migrations into Your Binary Using Goose

https://playtechnique.io/blog/compiled-goose-migrations.html
2•gwynforthewyn•7mo ago

Comments

gwynforthewyn•7mo ago
Figuring out the technique for this involved reading a number of github issues, so I tried to make it as simple as possible to see what the 2 step process is to be able to compile your migrations.

The benefit of this approach with migrations is being able to use golang itself to figure out if a migration should run e.g. you can check an environment variable to see if you're in the dev environment and if you are then you could run a migration to populate your seed data.