mirror of https://github.com/django/django.git
Refs #31777 -- Doc'd Char/TextField.db_collation parameter in MySQL notes.
This commit is contained in:
parent
06c5d3fafc
commit
292b3be698
|
@ -398,11 +398,15 @@ Collation settings
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The collation setting for a column controls the order in which data is sorted
|
The collation setting for a column controls the order in which data is sorted
|
||||||
as well as what strings compare as equal. It can be set on a database-wide
|
as well as what strings compare as equal. You can specify the ``db_collation``
|
||||||
level and also per-table and per-column. This is `documented thoroughly`_ in
|
parameter to set the collation name of the column for
|
||||||
the MySQL documentation. In all cases, you set the collation by directly
|
:attr:`CharField <django.db.models.CharField.db_collation>` and
|
||||||
manipulating the database tables; Django doesn't provide a way to set this on
|
:attr:`TextField <django.db.models.TextField.db_collation>`.
|
||||||
the model definition.
|
|
||||||
|
The collation can also be set on a database-wide level and per-table. This is
|
||||||
|
`documented thoroughly`_ in the MySQL documentation. In such cases, you must
|
||||||
|
set the collation by directly manipulating the database settings or tables.
|
||||||
|
Django doesn't provide an API to change them.
|
||||||
|
|
||||||
.. _documented thoroughly: https://dev.mysql.com/doc/refman/en/charset.html
|
.. _documented thoroughly: https://dev.mysql.com/doc/refman/en/charset.html
|
||||||
|
|
||||||
|
@ -432,6 +436,10 @@ because it is more accurate.
|
||||||
differ only by case will pass validation, but upon calling ``save()``, an
|
differ only by case will pass validation, but upon calling ``save()``, an
|
||||||
``IntegrityError`` will be raised.
|
``IntegrityError`` will be raised.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.2
|
||||||
|
|
||||||
|
Support for setting a database collation for the field was added.
|
||||||
|
|
||||||
Connecting to the database
|
Connecting to the database
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue