W
W
WebDeveloper20162016-11-16 14:30:28
Django
WebDeveloper2016, 2016-11-16 14:30:28

How to remove a migration?

I accidentally made a bad migration and now I don't know how to delete it. :( That is, as if the migration had not yet passed, I just did makemigrations. It created the migration, but when migrating was called, it threw an error (I accidentally set the date field to an empty string by default). I fixed it and did makemigrations and migrate again, but it now continues to complain about that error on the migrate command.How to rollback that migration?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2016-11-16
@WebDeveloper2016

manage.py showmigrations
check if your migration installed. If not installed, then simply delete the file of this migration and create it again
Roll back to a certain previous migration:
(after that files of later migrations can be deleted)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question