Let's say I'm working in git
on my Rails
app, and I have two branches, each with their own migration.
1) branch001
creates a table called tableA
via migration 20160101000000_create_table_A
2) branch002
creates a table called tableB
via migration 20160101000001_create_table_B
Clearly the timestamp for the 2nd migration was created after the first.
But let's say I merge branch002
to master
first because it's ready first. My schema file becomes -
ActiveRecord::Schema.define(version: 20160101000001) do
....
end
The schema version tells activerecord it's already patched to a level/version greater than my first branch.
What will happen when I finally get around to merging my first branch?
- Will the schema version regress to
20160101000000
? - Will there be any issues running the first branch's migration because the schema sees it's already "patched" and skips it?
- In general, what's the best practice for things like this? Should I rename the first branch with a new, more recent timestamp?
Thanks!
EDIT -
Really wondering what I should do to resolve the merge conflict when I merge the 2nd branch into master
. Should I leave it as the later timestamp or regress it to the earlier timestamp?
<<<<<<< HEAD (master)
ActiveRecord::Schema.define(version: 20160101000001) do
=======
ActiveRecord::Schema.define(version: 20160101000000) do
>>>>>>> 282cda7... Adding Table B