# frozen_string_literal: true ROM::SQL.migration do change do create_table :event_participants do primary_key :id foreign_key :event_id, :events, null: false foreign_key :player_id, :players, null: false foreign_key :team_id, :teams column :status, String, default: 'registered' # registered, checked_in, active, eliminated column :seed, Integer column :registration_date, DateTime, null: false, default: Sequel::CURRENT_TIMESTAMP end add_index :event_participants, [:event_id, :player_id], unique: true add_index :event_participants, [:event_id, :team_id] end end