#29904: Not Null CharField Doesn't generate DB constraint on Oracle
------------------------------+--------------------------------------
Reporter: Vackar Afzal | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 2.0
Severity: Normal | Resolution:
Keywords: Contraints | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by Vackar Afzal):
* status: closed => new
* resolution: invalid =>
Comment:
Thanks for the information. After reviewing however I would argue that
this behaviour is invalid.
I agree that an empty string and a null value are under most circumstances
interchangeable, but this is being conflated with the concept of
nullability.
Nullability has nothing to do with the representation of the null, just
wether or not the field may be null.
i.e If a column has a not null constraint, it should not accept an empty
string or 'Null'
With Django's current behaviour, since declaring a field as not null has
no effect, both 'Null' and '' may be inserted without issue.
I would argue that this is a broken design. How are raw queries enforced,
or additional clients that have no knowledge of the Django's internal
checks and conversions?
If Django needs to do internal checks, it should use the value of 'blank'
and not 'null' to be consistent with other backends. Oracle supports not
null constraints, why not exploit that?
--
Ticket URL: <https://code.djangoproject.com/ticket/29904#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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.6ac2e0ddfc390f7e10d06eaa7533e54b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.