How to Reset Migrations


The project is still in the development environment and you want to perform a full clean up. You don’t mind throwing the whole database away.

Drop Database

psql
drop database "packs4jobs";

Remove migrations files

find . -path "*/migrations/*.py" -not -name "__init__.py" -not -name "case_insensitive.py" -delete
find . -path "*/migrations/*.pyc"  -delete

Create Database

create database packs4jobs;
grant all privileges on database packs4jobs to packs4jobs;
python manage.py migrate core case_insensitive

Comments

Popular posts from this blog

Installing the Certbot Let’s Encrypt Client for NGINX on Amazon Linux 2

psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found

Deploy Nuxt.js app using Apache 2