Para PK customizada em Rails, crie tabela sem id e adicione PK manualmente, depois defina no model.
create_table :table, id: false do |t|
t.string :id, null: false
end
execute "ALTER TABLE table ADD PRIMARY KEY (id);"self.primary_key = :id
Para PK customizada em Rails, crie tabela sem id e adicione PK manualmente, depois defina no model.
create_table :table, id: false do |t|
t.string :id, null: false
end
execute "ALTER TABLE table ADD PRIMARY KEY (id);"self.primary_key = :id