我删除了一些与应用程序相关的表。再试一次syncdb命令
python manage.py syncdb
它显示错误
django.db.utils.ProgrammingError: (1146, "Table 'someapp.feed' doesn't exist")
models.py
class feed(models.Model): user = models.ForeignKey(User,null=True,blank=True) feed_text = models.CharField(max_length=2000) date = models.CharField(max_length=30) upvote = models.IntegerField(default=0) downvote = models.IntegerField(default=0) def __str__(self): return feed.content
我该如何获取该应用程序的表格?
如果Django版本> = 1.7:
python manage.py makemigrations python manage.py migrate --fake
其他
python manage.py schemamigration someapp --auto python manage.py migrate someapp --fake