Skip to content

Commit

Permalink
Fixed #19312 -- Documented MySQL TIMESTAMP columns cannot be used wit…
Browse files Browse the repository at this point in the history
…h USE_TZ=True.
  • Loading branch information
timgraham committed Aug 26, 2014
1 parent 60428ed commit 348c89c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/ref/databases.txt
Expand Up @@ -500,6 +500,15 @@ respectively, a ``ValueError`` is raised rather than truncating data.
MySQL does not store fractions of seconds. Fractions of seconds are truncated MySQL does not store fractions of seconds. Fractions of seconds are truncated
to zero when the time is stored. 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()`` Row locking with ``QuerySet.select_for_update()``
------------------------------------------------- -------------------------------------------------


Expand Down

0 comments on commit 348c89c

Please sign in to comment.