#16077: syncdb, PostgreSQL: models.IntegerField default value is absent in the
created SQL
-------------------------+----------------------------------------------
 Reporter:  maretskiy@…  |          Owner:  nobody
     Type:  Bug          |         Status:  new
Milestone:               |      Component:  Database layer (models, ORM)
  Version:  1.3          |       Severity:  Normal
 Keywords:               |   Triage Stage:  Unreviewed
Has patch:  0            |  Easy pickings:  0
-------------------------+----------------------------------------------
 If some model has an IntegerField with option "default" set, then
 "./manage.py syncdb" will create PostgreSQL table with integer field
 without "DEFAULT" SQL keyword. So that is impossible to set default value
 for this model attribute.

 ''Example:''

 model:
   class AmProfile(models.Model):
       my_field = models.IntegerField(default=1)

 produced SQL:
   my_field integer NOT NULL,

 but should be:
   my_field integer DEFAULT 1 NOT NULL,

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16077>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to