This all fits into the generic category of the old joke:
Patient in doctor’s office: “Doctor, it hurts when I do this”.
Doctor’s response: “Then don’t do that!”
Now that you’ve explained more as to what happened, I’m guessing what the situation really was that in running the migration step, you got the prompt asking for the default value to use. So in this case, if my conjecture is true regarding this, then you had made the migrations correctly, and Django was doing exactly what it should have done and you were not in any sort of problem.
Had you asked at that point what to do, I would have suggested what I mentioned above - find the ID of your superuser, and use that numeric value as the default. You would have then been able to continue moving forward without issue, and you wouldn’t be facing this situation.
You don’t need to be “careful” with migrations, you just need to not intentionally break it, without knowing what you’re doing and what the side effects are.
(I do seem to remember an earlier conversation where you had emptied some tables that you shouldn’t have.)
I guess the best way to put it is, when you’re using migrations, you don’t own the database, Django does. You don’t own the tables, Django does. You don’t own those migration files, Django does.
But even beyond that, logically, it’s really not much different than if you were to arbitrarily delete any other file in your project. Delete your urls.py file? Not going to work. Delete your views.py file? Not going to work. So I’d think real hard about why I’d think that deleting a migration file - or any other file in the project - isn’t going to break something unless I take other actions as well.
You’re currently of the opinion that “the only way to fix this is by deleting the whole database”. That’s not true. Regardless of what you’ve done, it’s almost impossible to get to that point where the only way to fix it is dropping and recreating the database. It’s more an issue of how much time will it take to fix it, and in the development cycle, it may be significantly quicker to do that than anything else.
(And, if you’re going to go that route, it’s also a perfect time to delete all your existing migrations, so that when you do your initial makemigrations, you’re going to initially create a migration based upon the current state of your models rather than having to process x
migrations to get to the current state.)