Hi,
I'm hoping for some wisdom on how to set up my PostgreSQL migration / Ruby
code to handle a scenario where I'm *storing a primary_key value that can
be either a String or an Integer in another table.*
create_table(:my_table) do
primary_key :id
column :model_pk :text
....
end
And then I would add a row to MyTable like this:
MyTable.create(model_pk: model.id, ...) # integer
or
MyTable.create(model_pk: model.string_pk, ...) # string primary_key
When I run this code against Postgres, I get this error:
Sequel::DatabaseError: PG::UndefinedFunction: ERROR: operator does
not exist: text = integer
How can I overcome this issue with a Sequel migration?
Thanks for your time
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.