From 5ca82e710e2f92b8c5114492205c8764918407d3 Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Sun, 21 Dec 2014 14:36:37 +0000 Subject: Fixed #24033 -- Use interval type on Oracle. Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than storing as a NUMBER(19) of microseconds. There are issues with cx_Oracle which require some extra data manipulation in the database backend when constructing queries, but it handles the conversion back to timedelta objects cleanly. Thanks to Shai for the review. --- docs/ref/models/fields.txt | 3 ++- docs/releases/1.8.txt | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 203241ae5f..5eabf84cad 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -551,7 +551,8 @@ The default form widget for this field is a :class:`~django.forms.TextInput`. A field for storing periods of time - modeled in Python by :class:`~python:datetime.timedelta`. When used on PostgreSQL, the data type -used is an ``interval``, otherwise a ``bigint`` of microseconds is used. +used is an ``interval`` and on Oracle the data type is ``INTERVAL DAY(9) TO +SECOND(6)``. Otherwise a ``bigint`` of microseconds is used. .. note:: diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 25d71e1235..77609ed7b5 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -60,9 +60,10 @@ New data types * Django now has a :class:`~django.db.models.DurationField` for storing periods of time - modeled in Python by :class:`~python:datetime.timedelta`. It is - stored in the native ``interval`` data type on PostgreSQL and as a ``bigint`` - of microseconds on other backends. Date and time related arithmetic has also - been improved on all backends. There is a corresponding :class:`form field + stored in the native ``interval`` data type on PostgreSQL, as a ``INTERVAL + DAY(9) TO SECOND(6)`` on Oracle, and as a ``bigint`` of microseconds on other + backends. Date and time related arithmetic has also been improved on all + backends. There is a corresponding :class:`form field `. Query Expressions -- cgit v1.3