Skip to content

Addressing breaking change migrations

Laura Beaufort edited this page Dec 17, 2024 · 5 revisions

Remediate errors

Reference https://github.com/3YOURMIND/django-migration-linter/blob/main/docs/incompatibilities.md for information on remediating errors.

Running locally

Inside docker: API container, exec tab:

python manage.py makemigrations

Deprecate field

  1. Mark field as deprecated (see django-deprecate-fields docs)
  2. Generate migration
  3. Enter follow-up issue for future sprint to remove the field. This migration will need to be ignored by the linter. Example: https://github.com/fecgov/fecfile-web-api/pull/1224/commits/f151ecf4cd1125460a6b3709e694d6d3603464a4

Ignore migration error

  1. Confirm with Tech lead on this choice
  2. See https://github.com/3YOURMIND/django-migration-linter/blob/main/docs/usage.md#ignoring-migrations
  3. Example: https://github.com/fecgov/fecfile-web-api/pull/1224/commits/f151ecf4cd1125460a6b3709e694d6d3603464a4

Manually test reversing your migrations

https://docs.djangoproject.com/en/5.1/topics/migrations/#reversing-migrations