How to Compile Your DB Migrations into Your Binary Using Goose

2 gwynforthewyn 1 5/28/2025, 12:28:25 AM playtechnique.io ↗

Comments (1)

gwynforthewyn · 1d 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.