promotably / api

API service
Eclipse Public License 1.0
0 stars 1 forks source link

Move Migrations To Their Own Repo #248

Open bpromo opened 9 years ago

bpromo commented 9 years ago

@cvillecsteele @smnirven @wgb @vrivellino https://github.com/promotably/mig

Next step would be to write a version for mig to the db and give consumers of the lib a function to call to see if they are at the right version ... but I'm not sure if thats a good idea.

What we are trying to protect against is an app using the db when their understanding of it is out of date. The problem is we've decided, now that we have a separate repo, that db migrations will happen before apps are upgraded. So there will always be some window were the version will be out of date.

The second issue is that unless you check the version on every query to the database it really only protects you when a process is starting up.

I think we should integrate the new migrations and run them separately from our apps, but not try to pretend like we've made out selves more protected. If we want to be protected we will have to bite the bullet and give each 'writer' either its own db and migrations or some sort of API (http/json, queue) to talk to another app that has control of a db and migrations. Until then we will all just need to really try to never break backwards compatibility.