Django can't migrate after cloning repository

Viewed 479

I've been working on a Django app on another machine, with a local postgis database. I pushed the entire thing to GitHub, except what is in the .gitignore.

.gitignore

venv
*.pyc
staticfiles
.env
.idea
uploads

Came home and cloned the repo, installed all the requirements and created a new local Postgres database with the same settings from settings.py and the same PostGIS extension.

settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'db_name',
        'USER': 'postgres',
        'PASSWORD': '******',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

But I can't create any migrations. I just get an error.

django.db.utils.ProgrammingError: relation "something_something" does not exist

I have tried rolling back to the first initial migration file, but with the same result.

makemigrations applabel 0001

It is as if Django think it is still the same database, but with all the tables missing. But I can't migrate and get Django to create them.

How can I get out of this mess? Can I for a migrate somehow?

If you need additional information, that I've left out please ask.

1 Answers
Related