Removing unused code is a good practice. But is DB migrations script file an exception in this practice?
I have to maintain a Laravel application and I'm in the process of cleaning up unused code and I found out I have lots migrations scripts. My migration includes adding and dropping table columns.
Anyone who have encountered the same situation? Thanks!
If the migration does not affect anything on the database, then it is fine to remove them.
But, if they affect, even a little part like adding/removing (same or different) columns, changing types ... then look up current data carefully if your in PRODUCTION; otherwise, refactoring before production is good.
If you know you wont need does migration files later in your project lifespan, remove it but i advice you backing up your application before.