Skip to content

Commit

Permalink
Squash Django migrations (step 1)
Browse files Browse the repository at this point in the history
This change squashes Django migrations for all Django apps with more
than 3 migrations. See our internal squashing documentation here [0]
and Django's general docs on squashing here [1].

Migration squashing requires multiple steps:

1. Commit squashed migrations, and deploy them.
2. Delete migration files that were squashed, and remove "replaces" in
the squashed migration files. Deploy this change.

This squashing removes some RunPython code that is only compatible with
PostgreSQL; after this squash it will once again be possible to migrate
a SQLite database.

[0] https://cfpb.github.io/consumerfinance.gov/migrations/#squashing-migrations
[1] https://docs.djangoproject.com/en/5.1/topics/migrations/#squashing-migrations
  • Loading branch information
chosak committed Jan 6, 2025
1 parent 253101c commit df6b9a0
Show file tree
Hide file tree
Showing 10 changed files with 2,645 additions and 0 deletions.
152 changes: 152 additions & 0 deletions cfgov/ask_cfpb/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions cfgov/filing_instruction_guide/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions cfgov/form_explainer/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions cfgov/paying_for_college/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions cfgov/regulations3k/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

183 changes: 183 additions & 0 deletions cfgov/tccp/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

267 changes: 267 additions & 0 deletions cfgov/teachers_digital_platform/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

801 changes: 801 additions & 0 deletions cfgov/v1/migrations/0001_2024_squash.py

Large diffs are not rendered by default.

640 changes: 640 additions & 0 deletions cfgov/v1/migrations/0018_2024_squash.py

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cfgov/v1/util/migrations.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import logging
import re

from django.utils.deconstruct import deconstructible

from wagtail.blocks.migrations.operations import BaseBlockOperation


logger = logging.getLogger(__name__)


@deconstructible
class RegexAlterBlockValueOperation(BaseBlockOperation):
"""Alter a block's value with a regex pattern and replacement"""

Expand Down

0 comments on commit df6b9a0

Please sign in to comment.