Files
kondiplo_front/db/migrate/20260211013256_create_participants.rb
kontei f25fd6f802
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
フロントエンドプレイアブル
2026-02-15 14:57:17 +09:00

17 lines
578 B
Ruby

class CreateParticipants < ActiveRecord::Migration[8.1]
def change
create_table :participants do |t|
t.references :user, null: false, foreign_key: true
t.references :game, null: false, foreign_key: true
t.string :power, null: true
t.boolean :orders_submitted, default: false, null: false
t.boolean :is_administrator, default: false, null: false
t.timestamps
end
add_index :participants, [:user_id, :game_id], unique: true
add_index :participants, [:game_id, :power], unique: true, where: "power IS NOT NULL"
end
end