Re: syncdb fails to update Not NULL property in PostgreSQL 8.4

2009-10-21 Thread Tomasz Zieliński


On 21 Paź, 19:20, "Thomas B. Higgins" 
wrote:
> Using the SVN trunk version of Django, I have observed that if a model
> IntegerField or FloatField is changed by adding "null=True" syncdb
> does not update the Not NULL property of the column using PostgeSQL
> 8.4. Is this correct behavior, or a bug? The two easy workarounds are
> (1) drop the table using pgAdmin III and follow with a syncdb creating
> a new table which will have the correct Not NULL status, or (2)
> manually change the Not Null property value for the column using
> pgAdmin III. Obviously the first method is a bit extreme.

There is also method (3) - use migration app, I suggest you take
a look at South: http://south.aeracode.org - it's very easy to pickup
up.

--
Tomasz Zielinski,
http://pyconsultant.eu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: syncdb fails to update Not NULL property in PostgreSQL 8.4

2009-10-21 Thread Karen Tracey
On Wed, Oct 21, 2009 at 1:20 PM, Thomas B. Higgins  wrote:

>
> Using the SVN trunk version of Django, I have observed that if a model
> IntegerField or FloatField is changed by adding "null=True" syncdb
> does not update the Not NULL property of the column using PostgeSQL
> 8.4. Is this correct behavior, or a bug?


It's a documented restriction:

http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb

Integrating some schema evolution into the Django base is a long-term goal,
but it's not close yet.  In the meantime there are multiple external
projects that provide function like this.  Search on Django schema migration
or evolution and you should find pointers to them.

Karen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



syncdb fails to update Not NULL property in PostgreSQL 8.4

2009-10-21 Thread Thomas B. Higgins

Using the SVN trunk version of Django, I have observed that if a model
IntegerField or FloatField is changed by adding "null=True" syncdb
does not update the Not NULL property of the column using PostgeSQL
8.4. Is this correct behavior, or a bug? The two easy workarounds are
(1) drop the table using pgAdmin III and follow with a syncdb creating
a new table which will have the correct Not NULL status, or (2)
manually change the Not Null property value for the column using
pgAdmin III. Obviously the first method is a bit extreme.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---