Acewind
Acewind

Reputation: 143

How can reset django apps which migration folder was deleletd?

In my django app path, the migrations folder was deleted, but I want to recover it, when executing migrate command:

python manage.py migrate --fake api.desktops CommandError: App 'api.desktops' does not have migrations (you cannot selectively sync unmigrated apps)

How can reset those app?

Upvotes: 0

Views: 372

Answers (1)

Stuart Dines
Stuart Dines

Reputation: 758

If your database and and app are synchronised you should be able to do the following:

./manage makemigrations <app_name>
./manage migrate <app_name> --fake

If the database is out of sync you can also perform the same as above but will need to manually alter your database to align with the new migration structure.

Upvotes: 1

Related Questions