class CreateComplaintVotes < ActiveRecord::Migration[7.0] def change create_table :complaint_votes do |t| t.references :complainable, polymorphic: true, index: true t.integer :pros t.integer :cons t.timestamps end add_index :complaint_votes, [:complainable_id], name: 'complainable' end end