【发布时间】:2012-02-03 02:50:29
【问题描述】:
我对 git 还很陌生,我已经开始使用多个分支来同时使用 git branch、git checkout 等命令构建不同的功能。
这是我已采取的步骤列表:
git checkout feature1
make some changes that include migrations
rake db:migrate
rake db:commit to feature1 with schema.rb
git checkout feature2
# at this point my schema appears to revert to pre-feature1
make some changes that involve a new migration
rake db:migrate
# schema now shows changes from BOTH feature1 and feature2.
在 feature2 中运行 rake db:migrate 的行为刷新了架构,我想这反映了我支持 feature1 和 feature2 的本地数据库。您知道我可以做些什么来使这些迁移分开,以便每个功能都可以有自己的架构,还是有其他方法来处理分支迁移?
【问题讨论】:
标签: ruby-on-rails git migration git-branch database-migration