Open
Description
I was using sqlite3 for my database, and then I switched to postgres database, then I deleted all my migrations to start from clean sheet. Now when I run command python manage.py makemigrations
I get
...
...
...
django.db.utils.ProgrammingError: relation "scholarship_scholarshipconfiguration" does not exist
LINE 1: ...larship_scholarshipconfiguration"."deadline" FROM "scholarsh...
here is my model:
from django.db import models
from solo.models import SingletonModel
class ScholarshipConfiguration(SingletonModel):
is_active = models.BooleanField(default=False)
application_template = models.FileField(upload_to='scholarship_templates/')
deadline = models.DateField()
class ScholarshipApplication(models.Model):
first_name = models.CharField(max_length=100, null=False, blank=False)
last_name = models.CharField(max_length=100, null=False, blank=False)
application = models.FileField(upload_to='scholarship_applications/', null=False, blank=False)
class Meta:
verbose_name = 'Scholarship Application'
verbose_name_plural = 'Scholarship Applications'
and my database setups for sqlite3 and postgres:
sqlite
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
postgres
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '<dbname>',
'USER': '<user>',
'PASSWORD': os.environ.get('DB_PASSWORD', ''),
'HOST': 'localhost',
'PORT': '',
}
}
After getting error I switched back to sqlite3 and made sure that it works on sqlite3