Uploaded image for project: 'Cost Management'
  1. Cost Management
  2. COST-475

Quick, Consistent Migration Squashing

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Obsolete
    • Icon: Normal Normal
    • None
    • None
    • API
    • Hide
      * Database created consistently after migration squash (all objects created successfully, matching original migration output)
      * Can consistently squash migrations
      Show
      * Database created consistently after migration squash (all objects created successfully, matching original migration output) * Can consistently squash migrations

      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.

              Unassigned Unassigned
              hproctor HAP Proctor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: