2009/7/17 Lokesh <lokeshmarema...@gmail.com>:
>
> Hi,
>
> Initially the table created with the following code
> Class user_privileges(models.Model):
>    user_id = models.ForeignKey(User)
>    is_deleted= models.CharField(null=False, blank=False,
> max_length=1)
>    is_email_active = models.CharField(null=False, blank=False,
> max_length=1)
>
> Now I would like to add the one more column to the "user_privileges"
> model
>    is_phone_active = models.CharField(null=False, blank=False,
> max_length=1)
>
> The changes are not taken place when I do the "manage.py syncdb" after
> adding the new column into the model.
>

Remember that "manage.py syncdb" only check if the table exits/not
exits, it doesn't check structures. So if all the model is in the
server, syncdb simply do nothing.

> Please guide me how do I modify the models after the initial creation.
>
> I am not supposed to drop the "user_privileges" table because this is
> linked to other tables as foreign key.
>
> Thanks in advance.
> --~--~---------~--~----~------------~-------~--~----~

I'm pretty new in Django, but i think that you need to make that
change manually in the database server, i mean: change the model
(adding the field) and change the structure of the table (adding the
field with the same characteristics).

Another option is to backup your data, drop all the tables, do
"manage.py syncdb" and recover the backup.

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

Reply via email to