For me, if there was a way to simply add missing columns that would be
enough. Any data manipulation should be done by a patch runner that can
be tested and automated, but simply adding missing columns to a table I
think should be done by syncdb.

The way I have approached this when producing ORMs in PHP that
automatically generate the schema is to create the classes table with
just the primary key column, then alter the table to add each of the
other columns. Then when you add new things to your model you can check
to see if the columns exist and use the exact same alter table sql
generation to add the new columns.

Perhaps if I get some time to read through and understand the syncdb code
I can produce an add_missing_columns command...

MIke

On 2/20/2007, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:

>
>On 2/19/07, kbochert <[EMAIL PROTECTED]> wrote:
>> If I have a Django model:
>>
>> class Poll(models.Model):
>>     ...
>>
>> and decide that I need another field in the table, how do I proceed
>> while keeping the data?
>
>Hi Karl,
>
>See the FAQ:
>
>"If I make changes to a model, how do I update the database?"
>http://www.djangoproject.com/documentation/faq/#if-i-make-changes-to-a-model-how-do-i-update-the-database
>
>Adrian
>
>--
>Adrian Holovaty
>holovaty.com | djangoproject.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to