Skip to content
Browse files

[1.7.x] Fixed #19312 -- Documented MySQL TIMESTAMP columns cannot be …

…used with USE_TZ=True.

Backport of 348c89c from master
  • Loading branch information...
1 parent 34116ad commit e920c900ec5189115ed8648c21952444c7790b34 @timgraham timgraham committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 docs/ref/databases.txt
9 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()``

0 comments on commit e920c90

Please sign in to comment.
Something went wrong with that request. Please try again.