Skip to content

fix: Add induced migration by django-parler 2.4#367

Open
fsbraun wants to merge 3 commits into
masterfrom
chore/dependencies
Open

fix: Add induced migration by django-parler 2.4#367
fsbraun wants to merge 3 commits into
masterfrom
chore/dependencies

Conversation

@fsbraun
Copy link
Copy Markdown
Member

@fsbraun fsbraun commented May 16, 2026

Summary by Sourcery

Update alias app to support django-parler 2.4 and include the corresponding schema migration.

New Features:

  • Add a new migration to align CategoryTranslation unique constraints with django-parler 2.4.

Bug Fixes:

  • Adjust migration check test configuration so it runs migrations instead of using dry-run, ensuring detection of pending schema changes.

Enhancements:

  • Bump the djangocms-alias package version to 3.2.0.
  • Raise the django-parler dependency minimum to 2.4 and refresh test requirements to match.

Related resources

Checklist

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 16, 2026

Reviewer's Guide

Updates djangocms-alias to version 3.2.0 with a raised django-parler dependency, adds the new migration induced by django-parler 2.4 for CategoryTranslation constraints, adjusts the migration-checking test to run real migrations, and aligns test requirements accordingly.

Entity relationship diagram for updated CategoryTranslation constraints

erDiagram
    CategoryTranslation {
        string name
        string language_code
        int master_id
    }

    CategoryTranslation ||--o{ CategoryTranslation : master

    %% Constraints
    %% unique_together (name, language_code)
    %% unique constraint (language_code, master) named djangocms_alias_category_translation_uniq_lang
Loading

File-Level Changes

Change Details Files
Bump package version and base dependency on django-parler for the library.
  • Update the djangocms_alias package version constant to 3.2.0
  • Increase the django-parler minimum version requirement from 1.4 to 2.4 in the main project configuration
  • Align test requirements files with the new django-parler minimum version across supported Python/Django/CMS matrices
djangocms_alias/__init__.py
pyproject.toml
tests/requirements/py311-dj52-cms50-default.txt
tests/requirements/py311-dj52-cms50-versioning.txt
tests/requirements/py312-dj52-cms50-default.txt
tests/requirements/py312-dj52-cms50-versioning.txt
tests/requirements/py312-dj60-cms50-default.txt
tests/requirements/py312-dj60-cms50-versioning.txt
tests/requirements/py313-dj52-cms50-default.txt
tests/requirements/py313-dj52-cms50-versioning.txt
tests/requirements/py313-dj60-cms50-default.txt
tests/requirements/py313-dj60-cms50-versioning.txt
tests/requirements/py313-djmain-cms50-default.txt
tests/requirements/py313-djmain-cms50-versioning.txt
tests/requirements/py313-djmain-cmsdev-default.txt
tests/requirements/py313-djmain-cmsdev-versioning.txt
tests/requirements/py314-dj52-cms50-default.txt
tests/requirements/py314-dj52-cms50-versioning.txt
tests/requirements/py314-dj60-cms50-default.txt
tests/requirements/py314-dj60-cms50-versioning.txt
tests/requirements/py314-djmain-cms50-default.txt
tests/requirements/py314-djmain-cms50-versioning.txt
tests/requirements/py314-djmain-cmsdev-default.txt
tests/requirements/py314-djmain-cmsdev-versioning.txt
Add migration reflecting django-parler 2.4-induced unique constraints on CategoryTranslation.
  • Introduce a new schema migration to change the unique_together definition on CategoryTranslation to use (name, language_code)
  • Add a database-level UniqueConstraint on CategoryTranslation for (language_code, master) with a specific constraint name
djangocms_alias/migrations/0008_alter_categorytranslation_unique_together_and_more.py
Adjust migration-checking test to actually apply migrations so django-parler 2.4-induced changes are detected and covered.
  • Change the migration test management command option from dry_run=True to dry_run=False so migrations are run rather than simulated, while keeping check_changes enabled to fail on missing migrations
tests/test_migrations.py
Document the new release and its changes in the changelog.
  • Update the changelog to include version 3.2.0 and describe the django-parler 2.4-induced migration and dependency bump
CHANGELOG.rst

Assessment against linked issues

Issue Objective Addressed Explanation
#366 Add the new 0008 migration altering CategoryTranslation constraints so that django-parler 2.4 does not cause a locally-generated migration.
#366 Update package metadata and dependencies so that the app officially targets django-parler 2.4 (the version that induces the new migration).

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Switching makemigrations in test_for_missing_migrations from dry_run=True to dry_run=False will cause the test run to actually create migration files on disk; consider keeping it as a dry run and instead asserting on the command output or using Django’s --check behavior to detect missing migrations without side effects.
  • The new migration 0008_alter_categorytranslation_unique_together_and_more is generated with a Django 6.1 dev snapshot header; you may want to regenerate it with one of the officially supported Django versions for this project to avoid unnecessary diffs and potential compatibility surprises.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Switching `makemigrations` in `test_for_missing_migrations` from `dry_run=True` to `dry_run=False` will cause the test run to actually create migration files on disk; consider keeping it as a dry run and instead asserting on the command output or using Django’s `--check` behavior to detect missing migrations without side effects.
- The new migration `0008_alter_categorytranslation_unique_together_and_more` is generated with a Django 6.1 dev snapshot header; you may want to regenerate it with one of the officially supported Django versions for this project to avoid unnecessary diffs and potential compatibility surprises.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

django-parler 2.4 induces new migration to djangocms-alias

1 participant