Re:Ask HN: Which stack do you use at your startup?
by xstartup on Friday February 16, 2018 @05:14AM
(#16391280)
How do you do migrations with Golang? Which ORM do you use?
[ Parent
| on HN ]
Re:Ask HN: Which stack do you use at your startup?
by zuzuleinen on Friday February 23, 2018 @10:05AM
(#16446677)
For ORM we use GORM: http://gorm.io
For migrations we use goose: https://github.com/pressly/goose
Re:Ask HN: Which stack do you use at your startup?
by abdelm on Friday February 16, 2018 @05:22AM
(#16391318)
This may be useful: https://github.com/mattes/migrate
Re:Ask HN: Which stack do you use at your startup?
by majewsky on Friday February 16, 2018 @07:58AM
(#16391981)
Seconded. I use it with the go-bindata backend and Postgres driver. Some notes:
- Migrations are written in plain SQL, so there may be portability issues if you need to support multiple DBs. (Or you need to write the same migration once per supported SQL dialect.)
- It does not `CREATE DATABASE` for you when applying the first migration. For my app that uses Postgres, I wrote some extra code to do that. Feel free to copy if you like: https://github.com/sapcc/limes/blob/ab4245a8f195672b808f990f...