KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a database that uses UUIDs as primary keys, like this: create_table "my_table", :id => false, :force => true do |t| t.string "id", :limit => 36 end However, when I try to use :references for foreign keys to that table, it generates integer columns for the ID. Can :references be instructed to deal with a non-integer ID? My migration for the referring table is like this: create_table "child_table" :id => false, :force => true do |t| t.string "id", :limit => 36 t.references :my_table end I know that I could just manually create :my_table_id and :my_table_type columns, but I'm wondering whether :references can be made to do its magic under these circumstances so that I don't have to handle the id+type explicitly throughout my code.
Tags (comma-separated)
Save Edits
Cancel