I have this model
class Category(models.Model):
category_name= models.CharField(max_length=255)
sub_category_ID = models.IntegerField(null=True, blank=True)
def __unicode__(self):
return self.category_name
I already have data in the table but I want to change the sub_category_ID
to without deleting the entire database.
class Category(models.Model):
category_name= models.CharField(max_length=255)
sub_category_ID = models.ForeignKey('self',null=True, blank=True)
def __unicode__(self):
return self.category_name
So I run syncdb after I changed the model and it gave me the warning.
The following content types are stale and need to be deleted:
uTriga | event_event_category
Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.`
I typed yes and now am getting the error
column app_category.sub_category_ID_id does not exist
column uTriga_category.sub_category_ID_id does not exist