#35589: AlterField should raise an error when changing primary key
----------------------------------+---------------------------------------
Reporter: Csirmaz Bendegúz | Type: New feature
Status: new | Component: Migrations
Version: dev | Severity: Normal
Keywords: primary key | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+---------------------------------------
At the moment, AlterField doesn't do anything if changing
`primary_key=False` -> `primary_key=True` or
`primary_key=True` -> `primary_key=False`.
The same goes for `CompositePrimaryKey` fields (when/if they are merged
#373).
Since changing the primary key is not supported by Django, AlterField
should raise an error instead of silently failing.
--
Ticket URL: <https://code.djangoproject.com/ticket/35589>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701909de5d45b-f392cd6d-5345-4169-922a-cb31c57e2881-000000%40eu-central-1.amazonses.com.