3 ms·
Generally your migrations folder is supposed to store a complete history of your DB. Maybe doing it the way you suggest is a better way, it's just a bit outside
by yummyfajitas 13y ago
Generally your migrations folder is supposed to store a complete history of your DB. Maybe doing it the way you suggest is a better way, it's just a bit outside the standard and to be honest I haven't thought carefully about the best way to structure code this way.
- sonnym 13y agoAlex at The Daily WTF wrote a great article on this subject. http://thedailywtf.com/Articles/Database-Changes-Done-Right.aspx http://thedailywtf.com/Articles/Database-Changes-Done-Right....
- penguindev 13y agoThat's a decent read, but unfortunately even running the same precisely-versioned and ordered change scripts against dev, test, prod dbs can produce divergent results depending on the data in the db at the time. For example, prod could have a null somewhere, or data using a different url encoding flavor.... etc. (Or if you're really lucky, even the current load on the database could make it fail... i.e. transaction serialization failure due to the random row order you attempted to lock) So it should have ended with 'you're doomed'.