[quote="cyyan"]1、两人分模块开发,两人生成的数据迁移文件各自从001开始编号,合在一起的时候如何处理?
2、如果碰到需要使用相同的数据表怎么办?是避免出现这种情况还是出现了有好的处理方式?[/quote]
前两天[url=http://www.iteye.com/topic/125789]一个关于hobo插件的帖子[/url]可以解决,他的思想是不要migration,把fields定义在model里,然后每次build的时候,根据model里fields的变化自动生成migration文件。这个功能还没有release,不太稳定。
它的英文原帖中有人回复提及[url=http://drysql.rubyforge.org/]DrySQL[/url]也是针对类似的问题。这是一个gem,扩展了ActiveRecord::Base,也是为了不要维护migration,更适合legacy system。
hobo的作者这样描述两者的区别:DRYSQL says “make my app behave exactly as the database schema says it should”, while this migration generator says “make the database structure be exactly what my application source-code says it should be”。个人更喜欢hobo的思想,希望它尽快release。
2、如果碰到需要使用相同的数据表怎么办?是避免出现这种情况还是出现了有好的处理方式?[/quote]
前两天[url=http://www.iteye.com/topic/125789]一个关于hobo插件的帖子[/url]可以解决,他的思想是不要migration,把fields定义在model里,然后每次build的时候,根据model里fields的变化自动生成migration文件。这个功能还没有release,不太稳定。
它的英文原帖中有人回复提及[url=http://drysql.rubyforge.org/]DrySQL[/url]也是针对类似的问题。这是一个gem,扩展了ActiveRecord::Base,也是为了不要维护migration,更适合legacy system。
hobo的作者这样描述两者的区别:DRYSQL says “make my app behave exactly as the database schema says it should”, while this migration generator says “make the database structure be exactly what my application source-code says it should be”。个人更喜欢hobo的思想,希望它尽快release。