diff options
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/fields.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 1dbc8c3998..1b80196183 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -1227,6 +1227,20 @@ that control how the relationship functions. the table for the model defining the relationship and the name of the field itself. +.. attribute:: ManyToManyField.db_constraint + + Controls whether or not constraints should be created in the database for + the foreign keys in the intermediary table. The default is ``True``, and + that's almost certainly what you want; setting this to ``False`` can be + very bad for data integrity. That said, here are some scenarios where you + might want to do this: + + * You have legacy data that is not valid. + * You're sharding your database. + + It is an error to pass both ``db_constraint`` and ``through``. + + .. _ref-onetoone: ``OneToOneField`` |
