अजगर 3, Django 1.8.5, PostgresDjango प्रवासन त्रुटि: स्तंभ मौजूद नहीं है
मैं एक मॉडल Sites
कि ठीक काम कर रहा है है। मैंने हाल ही में एक फ़ील्ड, airport_code जोड़ने और डेटा माइग्रेट करने का प्रयास किया।
django.db.utils.ProgrammingError: column sites_site.airport_code does not exist LINE 1: ..._site"."sitemap_public_id", "sites_site"."state", "sites_sit...
, इस, मतलब नहीं है क्योंकि स्तंभ जाहिर है जब मैं कोशिश कर रहा हूँ मौजूद नहीं है:
class Site(BaseModel):
objects = SiteManager()
name = models.CharField(max_length=200, unique=True)
domain = models.CharField(max_length=200, unique=True)
weather = models.CharField(max_length=10)
nearby_sites = models.ManyToManyField('self', symmetrical=False, blank=True)
users = models.ManyToManyField(settings.AUTH_USER_MODEL, blank=True)
facebook = models.URLField(max_length=200)
twitter = models.URLField(max_length=200)
header_override = models.TextField(blank=True)
email_header_override = models.TextField(blank=True)
timely_site_tag_id = models.IntegerField()
timely_featured_tag_id = models.IntegerField()
timely_domain = models.CharField(max_length=255)
sitemap_public_id = models.CharField(max_length=255)
state = models.CharField(max_length=24)
airport_code = JSONField()
हालांकि, जब मैं makemigrations
भाग गया मैं एक त्रुटि मिली माइग्रेशन के भीतर इसे बनाओ।
मैंने इस बग के बारे में कई प्रश्नों को देखा है जो अनुत्तरित हैं, या मैन्युअल रूप से माइग्रेशन फ़ाइल बनाने, या डेटाबेस को नष्ट करने और पुनर्निर्माण करने का समाधान है। यह ठीक समाधान नहीं है।
यह भी मेरे लिए क्या हो रहा है, लेकिन दुर्भाग्य से, मैं Django टूलबार का उपयोग नहीं कर रहा हूँ। सुनिश्चित नहीं है कि कैसे आगे बढ़ें ... –
Django टूलबार ने भी मेरे लिए काम किया। मेरा डेटाबेस SQLite है। – JimInCO