3 ms·
> What's your preferred approach to store table definitions and migrations? Schema versioning and ORM can be quite orthogonal, unless your ORM decides to be as
by majewsky 9y ago
> What's your preferred approach to store table definitions and migrations?
Schema versioning and ORM can be quite orthogonal, unless your ORM decides to be as opinionated about stuff as e.g. ActiveRecord. In Go, I use migrate [1] and Gorp [2]. Granted, I have to tell the column names to Gorp manually, but that is a minor annoyance which I'm happy to pay for clean separation of concerns.
> Doesn't [using SQL for table definitions and migrations] make them more susceptible to mistakes?
What mistakes do you have in mind? Typos etc. will be caught by tests that access the database. That leaves actual design errors, which can happen just as easily in ORM code as in SQL code.
[1] https://github.com/mattes/migrate https://github.com/mattes/migrate
[2] https://github.com/go-gorp/gorp https://github.com/go-gorp/gorp