Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating migration timestamps in feature branches

Let's say there's active development in both my main branch (devlop) and my feature branch. Both are adding migrations now and again. Before merging the feature branch into the main branch, I'm going to rebase it onto the main branch.

So it only makes sense for all the feature branch migrations to come after the most recent develop branch migration.

Is there a handy/advised way to do the renaming of these files? I can just generate dummy migrations and reuse the timestamps generated for them -- but I wonder if there's a best/common practice out there that I don't know about?

like image 838
John Bachir Avatar asked May 31 '11 04:05

John Bachir


1 Answers

I haven't found a rails feature to do this for you, but it would be nice to have a migration touch command or something. At any rate, what we do these days is just generate a new migration, copy the timestamp and rename the old one. Generally migrations are stand alone enough that the order doesn't matter, but occasionally we run into order dependencies so we need to update the timestamps.

like image 194
lobati Avatar answered Oct 11 '22 00:10

lobati