Fusion
Fusion

Reputation: 5482

Django 1.10 - It is safe to delete non-processed migration file?

I created a migration file using python3 manage.py makemigrations my_app. However I ran that command by mistake. Is it safe just to delete the newly created non-processed migration file? Or is there something else that needs to be done?

Upvotes: 0

Views: 57

Answers (2)

sprksh
sprksh

Reputation: 2404

If you have not run migrations, its cool. Only take care that it does not create any dependency issues. For example if running makemigrations created 5 migration files in 5 different folders, Be sure to delete each one of them.

But if the migration was run and somehow could not be completed, then you should revert back the changes also before deleting the migration files.

Be careful with it and see django_migrations table to be extra sure.

Upvotes: 2

Kevin Christopher Henry
Kevin Christopher Henry

Reputation: 49092

Until you run migrate there's no record of the migration other than the existence of the file in the migrations directory. So yes, it's perfectly safe to delete it.

Upvotes: 3

Related Questions