Dotcloudを使用してdjangoアプリをデプロイしています。私はPostgresをDBとして使用しています。
アプリに新しいモデルがあり、dbをフラッシュしてsyncdbしたいと思いました。私がそれをするとき、すべての仕事は見つけます。「Competition」という名前の新しいモデルが管理者に表示されます。
問題は、他のモデルであるMatchがモデルCompetitionのForeignKeyを持っていることです。また、管理者の[一致]に移動すると、次のエラーが発生します。
DatabaseError at /admin/myproject/match/
column myproject_match.competition_id does not exist
LINE 1: ...team_challenger_id", "sportdub_match"."sport_id", "sportdub_...
syncdbが機能しなかった理由について何か考えはありますか?
ご協力ありがとうございました。
編集:私の2つのモデル
class Competition(models.Model):
name = models.CharField(max_length=256)
comp_pic = models.ImageField(upload_to="comp_pics/")
def __unicode__(self):
return self.name
class Match(models.Model):
team_host = models.ForeignKey(Team, related_name='host_matches')
team_challenger = models.ForeignKey(Team, related_name= 'challenger_matches')
sport = models.ForeignKey(Sport)
competition = models.ForeignKey(Competition)