Skip to content

Commit

Permalink
[1.7.x] Fixed #19312 -- Documented MySQL TIMESTAMP columns cannot be …
Browse files Browse the repository at this point in the history
…used with USE_TZ=True.

Backport of 348c89c from master
  • Loading branch information
timgraham committed Aug 26, 2014
1 parent 34116ad commit e920c90
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/ref/databases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()``
-------------------------------------------------

Expand Down

0 comments on commit e920c90

Please sign in to comment.