You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
correction-tp-rails/db/migrate/20230326160630_create_comba...

14 lines
431 B

class CreateCombat < ActiveRecord::Migration[7.0]
def change
create_table :combats do |t|
t.integer :result
t.string :name
t.references :left_fighter, null: false, foreign_key: { to_table: 'creatures' }
t.references :right_fighter, null: false, foreign_key: { to_table: 'creatures' }
t.references :winner, null: true, foreign_key: { to_table: 'creatures' }
t.timestamps
end
end
end