Files
old-roraccounting/db/migrate/20200827142428_create_chip_values.rb
2020-09-04 04:07:43 +03:00

13 lines
402 B
Ruby

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