3 ms·
Check sql migrations into version control, all changes get checked in. Run them in a predefined order with a migration tool (something as simple as file name o
by grey-area 6y ago
Check sql migrations into version control, all changes get checked in.
Run them in a predefined order with a migration tool (something as simple as file name order is fine).
Save metadata in the db to ensure migrations are not run twice and keep a record (again migration tools can do this).
Test migrations multiple times prior to deploy using a sanitized copy of production.
Any of these steps would help, all of them would eliminate your problems.
- bb88 6y agoDjango does this.
- grey-area 6y agoDjango does some of these things (most migration tools do), but my understanding is it guides you in other directions (automated code-based migrations based on models as a source of truth), so if you want simple sql migrations you don't need (or even perhaps want) this part of django. That's what the article explores.