Git branching and migrations

18 views
Skip to first unread message

pierric...@inconcept.fr

unread,
Jul 23, 2014, 4:36:00 AM7/23/14
to rubyonra...@googlegroups.com
Hi,

Scuse my bad english. I will try to be as clear that I can.

I have a question about Rails migration and git branching model. 

My case:

I develop an API with Rails. I have lot of tables and therefore lot of migrations. 

I should create a new feature in my API which will introduce 1 year of development. I also should continue to add features to my main product.

I create a branch for my long time development. I have a branch A for my actual development and branch B for the feature.
I add migrations in both branches.

Now I deploy my branch A to the production. The migration version in branch A is higher than version in branch B.

When I will merge, the migrations of branch B will never be applied since their timestamp is older than those of my branch A.

Do you know a solution to my case?

Thank you.

Frederick Cheung

unread,
Jul 23, 2014, 5:20:11 AM7/23/14
to rubyonra...@googlegroups.com

On Wednesday, July 23, 2014 9:36:00 AM UTC+1, pierric...@inconcept.fr wrote:
Now I deploy my branch A to the production. The migration version in branch A is higher than version in branch B.
 

When I will merge, the migrations of branch B will never be applied since their timestamp is older than those of my branch A.

That's not true. rails will run all migrations not previously run (ie their timestamp is not in the schema_migrations table) in the order given by their timestamp

Fred
Reply all
Reply to author
Forward
0 new messages