As a developer, I want to be able to quickly and consistently squash migrations into a faster "bootstrap" migration.
As our migrations grow, the time it takes to execute them also grows. This is especially painful when creating a new tenant schema. It would be good to be able to programmatically squash all of these down to single set of migrations that will more quickly execute and from which we can create new migrations.
The issue here is quickly, consistently, programmatically. Since not all of our database objects are not controlled by models, we need to be able to rely on both the django model state as well as being able to run/re-run our procedure and materialized view scripts in an idempotent manner. Because of this, the built-in django migration squasher is ineffective and can trip over itself.
I suggest having our sql scripts written in such a way as to check for object existence before running commands or to destroy and recreate exact copies of the object with minimal locking. Also, it may be more advantageous to destroy history and make migrations from scratch as a means of having django squash migrations. A POC may need to be built to test this out.
- is blocked by
-
COST-413 Create new partitioned tables via migration
- Closed