A rails app I am developing currently has about 35 migrations up to this point. Since the application started as an experiment, there is a fair amount of meaningless churn in the migrations as I went back and forth between different ideas.
Are there any drawbacks to collapsing migrations 1-35 into one migration? I was planning to do this by having the first migration load the schema as it is now and deleting all the previous migrations.
I am currently the only person working on this project, if that makes a difference.
If you have your code under source control (you do have your code under source control, don't you?) then I'd say there's no real harm, provided you accept that rolling back schema changes is going to require either restoration of old migrations or brand new migrations. Just be sure you understand the implications and accept them before setting anything in stone.
Your current schema.rb can form the basis of a new single migration that will start a new set.
Be warned that if you have data manipulation operations in your existing migrations, static data loads, for example, and/or possible subsequent transformations, then these will need to be handled somewhere. It's something I've tripped over a few times...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With