Skip to content

Squash migrations

Bengfort requested to merge squash-migrations into main

Due to the complicated migration for !2066 (merged), castellum needs to be updated to 0.67.0 before it can be updated to 0.68.0. That means there is no reason to include migrations from versions prior to 0.67.0 for future releases. So I squashed all of those migrations.

I have already done something similar on !1638 (merged). This time I did not use the squashmigrations command though. Instead I deleted all migrations, ran makemigrations and then manually added the replaces attributes. This resulted in some weird combinations (e.g. appointments.0002_squashed_appointment_participation replacing appointments.0002_status_wording), but it works anyway because we can be sure that all of these migrations have already run.

To validate that it works as expected I performed two manual tests:

  • fresh database
    make reset_databases
  • from existing database
    git checkout 0.67.1
    make reset_databases
    git checkout squash-migrations
    make migrate
Edited by Hayat

Merge request reports