Re: syncdb doesn't updated database after adding null=True to an IntegerField

2009-07-17 Thread Shawn Milochik
> 
> Apart from django-evolution, also take a look at http://south.aeracode.org/


I second that -- I use South and it's really handy. I couldn't get  
Evolution to work (maybe I didn't wait long enough ^_^), but South  
does everything I need. The nice thing about it is that it's easily  
reversible or completely removable if you need to dump it -- just  
delete one database table and remove it from installed_apps.

Shawn
--~--~-~--~~~---~--~~
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 doesn't updated database after adding null=True to an IntegerField

2009-07-16 Thread Ramiro Morales

On Wed, Jul 15, 2009 at 11:33 PM, Ben wrote:
>
> I'm using the admin site. I noticed that I couldn't leave an
> IntegerField empty even when I had "year = models.IntegerField
> (blank=True)". I googled and found out I should set null=True as well.
> I did this, ran syncdb, and it didn't fix the issue.
>
> [...]
>
> Is syncdb supposed to fully sync the database to the model
> definitions? If so I would call this a bug.

No, it is documented behavior:

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

it is even listed in the FAQ:

http://docs.djangoproject.com/en/dev/faq/models/#if-i-make-changes-to-a-model-how-do-i-update-the-database

-- 
Ramiro Morales
http://rmorales.net

PyCon 2009 Argentina - Vie 4 y Sab 5 Septiembre
Buenos Aires, Argentina
http://ar.pycon.org/2009/about/

--~--~-~--~~~---~--~~
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 doesn't updated database after adding null=True to an IntegerField

2009-07-16 Thread chefsmart

>Is syncdb supposed to fully sync the database to the model
>definitions?

syncdb does not do that. I also often got confused about syncdb, but
now I never forget that syncdb currently does not help propagate
_modifications_ to models to your database. If you add a new model or
delete an existing model, it will take care of that. But if you make
changes to a model, it does not handle that.

Apart from django-evolution, also take a look at http://south.aeracode.org/

Regards,
CM

On Jul 16, 8:19 am, Dj Gilcrease  wrote:
> On Wed, Jul 15, 2009 at 8:33 PM, Ben wrote:
> > Is syncdb supposed to fully sync the database to the model
> > definitions? If so I would call this a bug.
>
> You would need to delete the tables and run syncdb again to get it to
> add any model level changes
>
> OR
>
> look uphttp://code.google.com/p/django-evolution/which will evolve
> you model changes into your existing DB
--~--~-~--~~~---~--~~
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 doesn't updated database after adding null=True to an IntegerField

2009-07-15 Thread Dj Gilcrease

On Wed, Jul 15, 2009 at 8:33 PM, Ben wrote:
> Is syncdb supposed to fully sync the database to the model
> definitions? If so I would call this a bug.

You would need to delete the tables and run syncdb again to get it to
add any model level changes

OR

look up http://code.google.com/p/django-evolution/ which will evolve
you model changes into your existing DB

--~--~-~--~~~---~--~~
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 doesn't updated database after adding null=True to an IntegerField

2009-07-15 Thread Ben

I'm using the admin site. I noticed that I couldn't leave an
IntegerField empty even when I had "year = models.IntegerField
(blank=True)". I googled and found out I should set null=True as well.
I did this, ran syncdb, and it didn't fix the issue.

I am using sqlite3 with a temporary database. I restarted my machine,
so that the database was deleted, ran syncdb, and the issue was fixed.
I tested again and it looks like once the database and tables are
created, adding null=True to an IntegerField and running syncdb won't
actually update the database.

Is syncdb supposed to fully sync the database to the model
definitions? If so I would call this a bug.

Comments?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---