summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-08-26 14:11:35 -0400
committerTim Graham <timograham@gmail.com>2014-08-26 14:11:53 -0400
commite920c900ec5189115ed8648c21952444c7790b34 (patch)
treed2c5ea2e155d834385540053490e07311220d9e6 /docs/ref
parent34116ad71c5f934fc2702c32a8cd743f36a85479 (diff)
[1.7.x] Fixed #19312 -- Documented MySQL TIMESTAMP columns cannot be used with USE_TZ=True.
Backport of 348c89cbfb from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/databases.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index f03d9c37b5..dde56a384e 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -525,6 +525,15 @@ respectively, a ``ValueError`` is raised rather than truncating data.
MySQL does not store fractions of seconds. Fractions of seconds are truncated
to zero when the time is stored.
+``TIMESTAMP`` columns
+~~~~~~~~~~~~~~~~~~~~~
+
+If you are using a legacy database that contains ``TIMESTAMP`` columns, you must
+set :setting:`USE_TZ = False <USE_TZ>` to avoid data corruption.
+:djadmin:`inspectdb` maps these columns to
+:class:`~django.db.models.DateTimeField` and if you enable timezone support,
+both MySQL and Django will attempt to convert the values from UTC to local time.
+
Row locking with ``QuerySet.select_for_update()``
-------------------------------------------------