3👍
✅
Start by inspecting the django_migrations
table. It contains data about which migrations have already run. Compare this data to the actual migrations files to learn which ones have run or not.
Finally, don’t be afraid to delete rows in django_migrations
and modify your original migrations files to recreate the tables you need.
5👍
You can use the sqlmigrate command to print the SQL commands that Django would execute. Then you can pick the commands necessary to recreate the tables you removed and apply them manually.
Once all the tables are in place again, you can use migrate <app_name> --fake
to forward the migration history, so Django knows that the migrations in this app are applied.
👤knbk
- [Django]-SSL error while running syncdb on Django with PostgreSQL
- [Django]-Implementing Name Synchronization and Money Transfers in Transactions Model with Account Number Input
- [Django]-Django: two sessions in the same browser
- [Django]-Django Count lines in a Subquery
- [Django]-Why is django slow to generate select boxes for foreign keys?
Source:stackexchange.com