我有一个Rails应用程序,我正在将它从Rails 1.2移植到2.3。我也将从Ruby MRI迁移到最新版本的JRuby。
在现有的(Rails1.2)应用程序中,我使用mysql_bigint插件来提供对64位整数作为主键的支持。
对于在MS SQL 2005数据库服务器上运行的新应用程序,我需要执行相同的操作。
我不确定这里的代码片段是否会有帮助:using UUID as primary key in rails and polymorph relationships
有什么想法从哪里开始呢?
提亚
戴夫
发布于 2010-05-27 00:34:02
将以下内容添加到config/environment.rb ment.rb:
module JdbcSpec
module MsSQL
def modify_types(tp)
super(tp)
tp[:primary_key] = "bigint NOT NULL IDENTITY(1, 1) PRIMARY KEY"
tp
end
end
endhttps://stackoverflow.com/questions/2884519
复制相似问题