#470: Add Field.db_default for defining database defaults
-------------------------------------+-------------------------------------
Reporter: jws | Owner: Lily
| Foote
Type: New feature | Status: assigned
Component: Database layer | Version:
(models, ORM) |
Severity: normal | Resolution:
Keywords: sql schema | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Lily Foote):
Replying to [comment:60 Adrian Torres]:
> I would argue that there is no legitimate reason to want to set e.g. a
literal value as default through python instead of through SQL.
The main reason I did it this way is backward compatibility, especially
with regards to migrations. If someone adds a field with a default in
Django 4.1, what should we do when they upgrade to 4.2?
--
Ticket URL: <https://code.djangoproject.com/ticket/470#comment:62>
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/0107018559854e35-3f88fa3f-35cb-4e1d-8147-b5d5ca0811ba-000000%40eu-central-1.amazonses.com.