#34131: Postgres AutoField change from serial to identity
-------------------------------------+-------------------------------------
Reporter: Marco Glauser | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Carlton Gibson):
I'm not sure I'd want to say this is supported 🤔
This a requires a RunSQL yes…?
{{{
ALTER TABLE invoice_invoice ALTER COLUMN id SET DEFAULT
luhn_generate(nextval('invoice_invoice_id_seq'));
}}}
So I'm not sure that we want to say that's covered by the stability of the
model field API — it's not like you're using the `default` kwarg here. 🤔
Rather, I'd want to say that you should be using a custom field for models
that need this functionality, and custom migrations to create that in the
DB. (Or similar)
--
Ticket URL: <https://code.djangoproject.com/ticket/34131#comment:3>
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/0107018456275b52-713c8be2-717e-4ddf-93a1-dfc7d29c9eaf-000000%40eu-central-1.amazonses.com.