迁移文件:
class CreateMyRecords < ActiveRecord::Migration
def change
create_table my_records:, :primary_key =>:partner_id do |t|
t.integer :partner_id, references: [:Partner, :partnerID]
t.integer :client_id, references: [:Client, :id]
end
end
end
如何使 partner_id 和 client_id 成为复合主键?感谢你!