In development, try to change the original migration for the table as your project progresses; thereafter, once project has been deployed, your ongoing migration should deal with the totality of schema change rather than instantaneous changes within a feature.
Migration Best Practices Question
When you deploy to a production environment and run a migrate command. If you want to ever update the tables, do you always just make new migration files everytime you want to do a schema change? It seems like then it’s really hard to see what the actual schema is because there would be hundreds of migration files for a single table if you’ve made changes over time. But do you just create a new migration file every time, to make sure the production database is aligned with the development?
Or do you ever just tweak a migration file, not run it on production, and just ALTER TABLE on the production database?
Please or to participate in this conversation.