I have a Rails app that I'm porting from Rails 1.2 to 2.3. I'm also moving from the Ruby MRI to the latest version of JRuby as well.
In the existing (Rails 1.2) app I use the mysql_bigint plugin to provide support for 64-bit ints as primary keys.
I need to to the same th开发者_Go百科ing for the new application running against a MS SQL 2005 database server.
I'm not sure if the snippet here would help: using UUID as primary key in rails and polymorph relationships
Any ideas where to start?
TIA
Dave
Add this to config/environment.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
end
精彩评论