views:

111

answers:

1

Hi all

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 thing for the new application running against a MS SQL 2005 database server.

I'm not sure if the snippet here would help: http://stackoverflow.com/questions/2654533/using-uuid-as-primary-key-in-rails-and-polymorph-relationships

Any ideas where to start?

TIA

Dave

A: 

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
David Collie