summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-08-27 09:29:13 -0400
committerTim Graham <timograham@gmail.com>2015-08-27 09:29:13 -0400
commite8cbc2b322d873a6fe39faca18d340ce93035087 (patch)
treeb7b095c86dc5e6938f6f778ff28f0d1efea72642 /docs
parent7bec480fe2ace94c8e7f0c88485442bfa74436b4 (diff)
Refs #2495 -- Documented that MySQL cannot have TextField(unique=True).
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/databases.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 831d32170a..4eb3ffda09 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -513,6 +513,14 @@ for the field. This affects :class:`~django.db.models.CharField`,
:class:`~django.db.models.SlugField` and
:class:`~django.db.models.CommaSeparatedIntegerField`.
+``TextField`` limitations
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+MySQL can index only the first N chars of a ``BLOB`` or ``TEXT`` column. Since
+``TextField`` doesn't have a defined length, you can't mark it as
+``unique=True``. MySQL will report: "BLOB/TEXT column '<db_column>' used in key
+specification without a key length".
+
.. _mysql-fractional-seconds:
Fractional seconds support for Time and DateTime fields