I have a model based on Sequel and Oracle adapter:
class Operation < Sequel::Model(DB[:operations])
end
If I try to create a record using Oracle's sequence.nextval as primary key:
Operation.create(
:id=>:nextval.qualify(:Soperations),
:payee_id=>12345,
:type=>"operation",
:origin=>"user-12345",
:parameters=>{}.to_s
)
I've got error: Sequel::Error: id is a restricted primary key
.
What's the correct way to create a record in such case or "map" Oracle's sequence to id
column? Or maybe, I have to use unrestrict_primary_key
?