summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-10-02 13:29:50 +0200
committerGitHub <noreply@github.com>2020-10-02 13:29:50 +0200
commit292b3be698ef58aff9c215d62a444f66ead578c3 (patch)
tree073c9caf3e8fd29980dff36e91f079fe31b0485d /docs
parent06c5d3fafc6aeb96387148726713b611aeba7fa1 (diff)
Refs #31777 -- Doc'd Char/TextField.db_collation parameter in MySQL notes.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/databases.txt18
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 8c87eb6818..809ee68db6 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -398,11 +398,15 @@ Collation settings
~~~~~~~~~~~~~~~~~~
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
-level and also per-table and per-column. This is `documented thoroughly`_ in
-the MySQL documentation. In all cases, you set the collation by directly
-manipulating the database tables; Django doesn't provide a way to set this on
-the model definition.
+as well as what strings compare as equal. You can specify the ``db_collation``
+parameter to set the collation name of the column for
+:attr:`CharField <django.db.models.CharField.db_collation>` and
+:attr:`TextField <django.db.models.TextField.db_collation>`.
+
+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
@@ -432,6 +436,10 @@ because it is more accurate.
differ only by case will pass validation, but upon calling ``save()``, an
``IntegrityError`` will be raised.
+.. versionchanged:: 3.2
+
+ Support for setting a database collation for the field was added.
+
Connecting to the database
--------------------------