Your development environment is production

The title might seem extreme, but there is a truth behind the statement. First a little back story, on the Django Discord we have begineers who have messed up their migrations somehow. This typically comes down to the fact that they have deleted the files but not dealt with the state of the database and don’t understand how the 2 are related. Since this is typically their first project, a simple solution is to delete the whole database and start from scratch.

Now I would hope it would be obvious why the above solution isn't ideal, especially in a production context. Purposely nuking the whole production database of a company is a quick way to being out of a job! In the above stories, I have yet to understand the specific reasoning for begineers deleting migration files, but if they were to take the hueristic to treat their development environment as a production environment, I would hope caution would be more front of mind.

Generally there is always a way forward to fix a problem that doesn't completely require a destructive solution. Treatding development as a production environment gives you this practice to think and consider alternative solutions.

For the record, my current development pattern means I rarely delete and recreate my development database and if I did, it would be due to certain features or requirements, not down to something being broken!