Skip to content

Releases: 3YOURMIND/django-migration-linter

5.1.0

30 Mar 11:00
183bdd5
Compare
Choose a tag to compare

Feature:

  • Support Django 5.0 db_default attribute (issue #275)
  • Allow ignoring the failures of sqlmigrate commands, with --ignore-sqlmigrate-errors option (issue #274)

Bug:

  • Don't detect 'IS NOT NULL' as backward incompatible changes (issue #263)
  • Don't consider UNIQUE INDEX creation as making a column not nullable

Miscellaneous:

  • Migrated from setup.py and setup.cfg to pyproject.toml
  • Add support for Python 3.12
  • Add support for Django 5.0
  • Avoid git command injections
  • Remove Codecov integration

5.0.0

09 Jul 12:58
Compare
Choose a tag to compare

Breaking change: stop silently ignoring when the internal sqlmigrate call fails and the linter cannot analyse the migration.
Instead, the linter crashes and lets the sqlmigrate error raise, in order to avoid letting a problematic migration pass.
One common reason for such an error is the SQL generation which requires the database to be actually migrated in order to fetch actual constraint names from it.
The crash is a sign to double-check the migration. But if you are certain the migration is safe, you can ignore it (issue #209)

Features:

  • Fixed RunPython model import check when using a through object like MyModel.many_to_many.through.objects.filter(...) (issue #218)
  • Mark the IgnoreMigration operation as elidable=True
  • Handle functools.partial functions in RunPython data migrations
  • Add a new check, CREATE_INDEX_EXCLUSIVE to detect index creation while an exclusive lock is held

Bug:

  • Don't detect not nullable field on partial index creation (issue #250)

Miscellaneous:

  • Add support for Python 3.11
  • Add support for Django 4.1
  • Add support for Django 4.2
  • Drop support for Django 2.2
  • Internally rename "migration tests" to "migration checks"
  • Add dataclasses internally instead of custom dicts
  • Use pre-commit hooks for linting
  • Add mypy and ruff usages

4.1.0

24 Apr 16:01
Compare
Choose a tag to compare
  • Allow configuring logging for makemigrations command and unify behaviour with lintmigrations (issue #207)
  • Adapt --warnings-as-errors option to allow selecting some migration tests only (issue #201)
  • Add sql_analyser option to makemigrations in order to specify the SQL analyser to use (issue #208)
  • Make project_root_path and verbosity configurable from other setting source (issue #203)

4.0.0

20 Feb 11:28
Compare
Choose a tag to compare
  • Drop support for Python 2.7, 3.5 and 3.6
  • Add support for Python 3.10
  • Drop support for Django 1.11, 2.0, 2.1, 3.0 and 3.1
  • Add support for Django 4.0
  • Fix index creation detection when table is being created in the transaction (issue #178)
  • Handle unique index creation as adding a unique constraint (issue #183)
  • Allow any option to be set/unset in config file (issue #167)
  • Allow using Django settings for any option to be set/unset (issue #198)
  • Raise when unsupported database vendor, allow passing an option to select SQL analyser (issue #138 and #169

3.0.1

14 Aug 13:27
Compare
Choose a tag to compare

Fixed bug:

  • Setting a field as NOT NULL without default passed the linter.

3.0.0

26 Jun 14:04
Compare
Choose a tag to compare

Breaking API change on lintmigrations command:

  • the positional argument GIT_COMMIT_ID becomes an optional argument with the named parameter --git-commit-id [GIT_COMMIT_ID]
  • the lintmigrations command takes now two positional arguments: lintmigrations [app_label] [migration_name]

New features:

  • raise warning when create or dropping an index in a non-concurrent manner using postgresql

Miscellaneous:

  • Add complete and working support for toml configuration files
  • Handle --verbosity 0 or -v 0 correctly to not print anything from the linter
  • Add code coverage to the linter
  • Renamed master branch to main

2.5.3

12 Apr 17:01
Compare
Choose a tag to compare
  • Stop packaging the 'tests' module into the release wheel file
  • Add Django 3.2 support

2.5.2

01 Apr 21:12
Compare
Choose a tag to compare
  • Remove toml support for config files

2.5.1

04 Feb 18:31
Compare
Choose a tag to compare
  • Remove .editorconfig from default config file
  • Allow utf-8 encoding in config files

2.5.0

31 Jan 16:55
Compare
Choose a tag to compare

Renamed lint checks:

  • REVERSIBLE_DATA_MIGRATION -> RUNPYTHON_REVERSIBLE
  • NAMING_CONVENTION_RUNPYTHON_ARGS -> RUNPYTHON_ARGS_NAMING_CONVENTION
  • DATA_MIGRATION_MODEL_IMPORT -> RUNPYTHON_MODEL_IMPORT
  • DATA_MIGRATION_MODEL_VARIABLE_NAME -> RUNPYTHON_MODEL_VARIABLE_NAME
  • REVERSIBLE_RUNSQL_DATA_MIGRATION -> RUNSQL_REVERSIBLE

Features/fixes:

  • Add Python 3.9 support
  • Make data migration model import error less strict (issue #121)
  • Add warning detection on RunPython call when model variable name is not the same as model class name
  • Run checks on RunSQL migration operations
  • Rename the RunPython data migration lint checks for improved consistency
  • Refactor and commonise the loggers, so that all modules the django_migration_linter logger
  • Allow using configuration file for linter options
  • Add option --include-name and --include-name-contains to only include migration with a certain name