Displaying 1 result from an estimated 1 matches for "pk2s".
Did you mean:
pk2
2009 May 01
1
how to disable auto-increment in primary key.
...ent for a primary key data type. The
purpose of using primary_key data type is using different name for
primary key. But we still want to use all the properties of "id"
except for auto increment part.
I had my migration as following
#=============MIGRATION
def self.up
create_table :pk2s , :id=> false do |t|
t.primary_key :uid
t.string :name
t.timestamps
end
end
# ========== Model
class Pk2 < ActiveRecord::Base
set_primary_key "uid"
end
--vipin