Re: Calling syncdb twice

2008-04-01 Thread Russell Keith-Magee


On 31/03/2008, at 10:51 PM, Evert Rol wrote:
>
>> I was wondering why you can only call "python manage.py syncdb" to
>> create your databases but after that if you change your models file
>> it work create the changes and you have to do them manually using  
>> SQL?
>
> I think there are several threads in this discussion group that have
> some mention of the hows and whys (google for them), but basically:
> it's too complicated, or otherwise very tricky, to alter tables
> (altering or adding columns) automatically. In particular, it won't
> even work with sqlite (http://www.sqlite.org/omitted.html).

This isn't entirely correct. It can be done; it's just difficult, and  
involves the production of a temporary table.

Another poster has pointed out that Django Evolution [1] is one of  
several implementations [2] of this functionality. One of these  
implementations may eventually be merged into trunk, but this won't  
happen until they are feature complete, and a consensus exists in the  
community as to the 'best' solution.

[1] http://code.google.com/p/django-evolution/
[2] http://code.djangoproject.com/wiki/SchemaEvolution

(Full disclosure - I'm a core developer of Django Evolution)

Yours,
Russ Magee %-)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Calling syncdb twice

2008-04-01 Thread James Matthews
Thank you!

On Tue, Apr 1, 2008 at 2:56 AM, blis102 <[EMAIL PROTECTED]> wrote:

>
> James,
>
> Django Evolution is a project that is working to take care of that
> problem (http://code.google.com/p/django-evolution/). I have not used
> it but, if what they say on their site is correct, it does what you
> are looking for:
>
> "When you run ./manage.py syncdb, Django will look for any new models
> that have been defined, and add a database table to represent those
> new models. However, if you make a change to an existing model, ./
> manage.py syncdb will not make any changes to the database.
>
> This is where Django Evolution fits in. Django Evolution is an
> extension to Django that allows you to track changes in your models
> over time, and to update the database to reflect those changes. "
>
> Hope that helps,
> Dana
>
> On Mar 31, 7:51 am, Evert Rol <[EMAIL PROTECTED]> wrote:
> > > I was wondering why you can only call "python manage.py syncdb" to
> > > create your databases but after that if you change your models file
> > > it work create the changes and you have to do them manually using SQL?
> >
> > I think there are several threads in this discussion group that have
> > some mention of the hows and whys (google for them), but basically:
> > it's too complicated, or otherwise very tricky, to alter tables
> > (altering or adding columns) automatically. In particular, it won't
> > even work with sqlite (http://www.sqlite.org/omitted.html).
> >
>


-- 
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Calling syncdb twice

2008-03-31 Thread blis102

James,

Django Evolution is a project that is working to take care of that
problem (http://code.google.com/p/django-evolution/). I have not used
it but, if what they say on their site is correct, it does what you
are looking for:

"When you run ./manage.py syncdb, Django will look for any new models
that have been defined, and add a database table to represent those
new models. However, if you make a change to an existing model, ./
manage.py syncdb will not make any changes to the database.

This is where Django Evolution fits in. Django Evolution is an
extension to Django that allows you to track changes in your models
over time, and to update the database to reflect those changes. "

Hope that helps,
Dana

On Mar 31, 7:51 am, Evert Rol <[EMAIL PROTECTED]> wrote:
> > I was wondering why you can only call "python manage.py syncdb" to
> > create your databases but after that if you change your models file
> > it work create the changes and you have to do them manually using SQL?
>
> I think there are several threads in this discussion group that have
> some mention of the hows and whys (google for them), but basically:
> it's too complicated, or otherwise very tricky, to alter tables
> (altering or adding columns) automatically. In particular, it won't
> even work with sqlite (http://www.sqlite.org/omitted.html).
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Calling syncdb twice

2008-03-31 Thread Evert Rol

> I was wondering why you can only call "python manage.py syncdb" to  
> create your databases but after that if you change your models file  
> it work create the changes and you have to do them manually using SQL?

I think there are several threads in this discussion group that have  
some mention of the hows and whys (google for them), but basically:  
it's too complicated, or otherwise very tricky, to alter tables  
(altering or adding columns) automatically. In particular, it won't  
even work with sqlite (http://www.sqlite.org/omitted.html).


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Calling syncdb twice

2008-03-31 Thread James Matthews
Hi,

I was wondering why you can only call "python manage.py syncdb" to create
your databases but after that if you change your models file it work create
the changes and you have to do them manually using SQL?

Thanks
James

-- 
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---