#30670: Document SchemaEditor.add_constraint()/remove_constraint() methods.
-------------------------------------+-------------------------------------
Reporter: akash1997 | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 2.2
Severity: Normal | Resolution:
Keywords: SchemaEditor, | Triage Stage: Accepted
unique_together, constraints |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by akash1997):
Replying to [comment:2 felixxm]:
> `alter_unique_together()` exists for altering
[https://docs.djangoproject.com/en/2.2/ref/models/options/#unique-together
Options.unique_together], i.e. a list of lists that must be unique when
considered together. It doesn't "alter" unique constraints in reality it
will add/remove unique constraints.
>
> `SchemaEditor` supports `add_constraint()` and `remove_constraint()`
operations for
[https://docs.djangoproject.com/en/2.2/ref/models/constraints/
Meta.constraints] manipulation, but it seems that they are
[https://docs.djangoproject.com/en/2.2/ref/schema-editor/ undocumented].
We should document them.
So does it mean that to alter a constraint, the old constraint needs to be
deleted and the new modified constraint must be added?
--
Ticket URL: <https://code.djangoproject.com/ticket/30670#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/067.9a3b5cf7eaffebeabe147d3e2f981214%40djangoproject.com.