Settings

Theme

How to Compile Your DB Migrations into Your Binary Using Goose

playtechnique.io

2 points by gwynforthewyn 7 months ago · 1 comment

Reader

gwynforthewynOP 7 months 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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection