4 ms·
I'm still confused. When do you generate your diff then? I think migrations ought to be done by the developer at the same time that they write their other code
by GlennS 6y ago
I'm still confused. When do you generate your diff then?
I think migrations ought to be done by the developer at the same time that they write their other code changes, because they have all the context at that time.
However, it doesn't seem like that could work for diffs, because the version of the production database you're diffing against may not be the same as the version you end up deploying to.
- djrobstep 6y agoGenerate it whenever you prefer, probably with the rest of the code changes as you say. Immediately before applying, check that the database is still in the same state as it was when you generated the diff script. If yes, apply. If no, abort.