#26053: makemigrations generates a wrong type for a DurationField column on
postgresql
-------------------------------------+-------------------------------------
Reporter: benjellounayoub | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) | Keywords: makemigrations,
Severity: Normal | DurationField, postgresql, psycopg2
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
'''Dependencies''':
- Django version : 1.9.1
- PostgreSQL version : "PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu,
compiled by gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1, 64-bit"
- DB conf :
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'test',
'USER': 'test',
'PASSWORD': 'test',
'HOST': 'localhost',
'PORT': '',
},
}
}}}
'''Following those steps:'''
1 - creating a minimal model example including a DurationField
{{{
class Foo(models.Model):
bar = models.DurationField()
}}}
2 - migrate the new model
{{{
$ python manage.py makemigrations AppName
$ python manage.py migrate
}}}
3 - then check the type of the 'bar' DB column related to the 'bar'
DurationField on the 'appname_foo' generated table
{{{
\d appname_foo
}}}
=> The datatype associated to the bar column is not interval as expected
but float
--
Ticket URL: <https://code.djangoproject.com/ticket/26053>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/058.f23e9982a1385685918ed6c767888154%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.