I am building a Django web application and I dropped the table django_migrations using psql command line and I want to recreate it.
Asked
Active
Viewed 315 times
1
-
2`manage.py migrate --fake …` and `--fake-initial` might be helpful. [docs](https://docs.djangoproject.com/en/3.1/ref/django-admin/#cmdoption-migrate-fake) – Klaus D. Dec 27 '20 at 20:23
-
1Thank you, I have used `python manage.py migrate --fake` and it worked and recreated the table. – ElFadily Mohamed Dec 27 '20 at 20:29
1 Answers
1
To recreate django_migrations simply use
./manage.py migrate --fake
But please be careful with that as mentioned here:
If you break something, nobody can help you probably, because the migration system will not know the current state of the database more. Therefore do a backup, write notes, use a sandbox and work precisely.

Maciej M
- 786
- 6
- 17
-
Thank you it worked, I updated a model fields when I access it it shows an error that % field doesnt exist, how can this be fixed? – ElFadily Mohamed Dec 27 '20 at 20:37