I can't make migration back, after i deleted them in Django

I am using Django with VSC. I got some problem with my database, so i did want to delete inside of migrations but by mistake i deleted directly folder of migrations. Anyway then i used the code;

python manage.py makemigrations 
python manage.py migrate --fake 

Then i got my migrations informations back. But the problem is, this time it didn't detect my own migrations. So when i click something have connection with database. I got a mistake like "No such table: MyMigrationsName" How can i fix it ?

OP can create there a folder named migrations in the place OP deleted and an __init.py__ file inside of it.

Then, if possible, drop the current database and run

python manage.py makemigrations
python manage.py migrate

Right now you can DROP database, delete all migration files, run makemigrations and create a new database with the new migration files.

Then never make the same mistake again.


python manage.py makemigrations "your_app_name"
py manage.py migrate "your_app_name"'

Make sure the app name is included. This solved my problem.

Back to Top