Opened 9 months ago

Closed 9 months ago

#35175 closed Bug (fixed)

Migration Operation CreateCollation kwargs are truncated when used with makemigrations --update

Reported by: Gerald Goh Owned by: David Sanders
Component: Migrations Version: 4.2
Severity: Normal Keywords:
Cc: Gerald Goh Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

For this case I have created an initial migration where a collation is the only operation
I wish to merge my initial user model creation with the collation creation so this is done at the same time.

Input (from 0001_collation.py)

        django.contrib.postgres.operations.CreateCollation(
            name='case_insensitive',
            provider='icu',
            locale='und-u-ks-level2',
            deterministic=False,
        ),

Expected Output (0001_initial.py)

        django.contrib.postgres.operations.CreateCollation(
            name='case_insensitive',
            provider='icu',
            locale='und-u-ks-level2',
            deterministic=False,
        ),

Actual Output (0001_initial.py)

        django.contrib.postgres.operations.CreateCollation(
            name='case_insensitive',
            locale='und-u-ks-level2',
        ),

Possibly caused by

django/contrib/postgres/operations.py:169

    def __init__(self, name, locale, *, provider="libc", deterministic=True):

With "provider" and "deterministic" being keyword arguments only.

Change History (6)

comment:1 by Gerald Goh, 9 months ago

Cc: Gerald Goh added

comment:2 by Gerald Goh, 9 months ago

Version: 5.04.2

comment:3 by David Sanders, 9 months ago

Summary: Migration Operation CreateCollation kwargs is truncated when used with makemigrations --updateMigration Operation CreateCollation kwargs are truncated when used with makemigrations --update
Triage Stage: UnreviewedAccepted

Thanks for the report 🏆

Confirmed that these kwargs disappear with an update.

comment:4 by David Sanders, 9 months ago

Has patch: set
Needs tests: set
Owner: changed from nobody to David Sanders
Status: newassigned

comment:5 by Mariusz Felisiak, 9 months ago

Needs tests: unset
Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 9 months ago

Resolution: fixed
Status: assignedclosed

In 06264258:

Fixed #35175 -- Made migraton writer preserve keyword-only arguments.

Thanks Gerald Goh for the report.

Note: See TracTickets for help on using tickets.
Back to Top