class CreateChipValues < ActiveRecord::Migration[5.2] def change create_table :chip_values do |t| t.references :base_chip, foreign_key: { to_table: :chips } t.references :secondary_chip, foreign_key: { to_table: :chips } t.decimal :value, precision: 12, scale: 3, null: false t.timestamps t.index [:base_chip_id, :secondary_chip_id], unique: true end end end