0

I have a migration file that used to add new column. When I fire up a new environment, it's much easier to run rake db:schema:load. And the migrations are redundant. All of that data is in the schema file. so can i delete it ? What do you think about that ?

utkuDAT
  • 334
  • 1
  • 3
  • 16

1 Answers1

1

Yes, you can. But wait a while. Once you're sure that no database will need to roll back over that migration, or use it to roll forward, then there's probably no harm in deleting it. And of course, lean on the safe side - leave the last however-many migrations, always. Don't be in a rush to delete a migration as soon as it's run.

Of course, if you're using version control (git or whatever) then you can always get your deleted migrations back if you really need them.

joshua.paling
  • 13,762
  • 4
  • 45
  • 60