# frozen_string_literal: true ROM::SQL.migration do change do create_table :bracket_matchups do primary_key :id foreign_key :event_id, :events, null: false foreign_key :round_id, :tournament_rounds, null: false foreign_key :match_id, :matches foreign_key :team_1_id, :teams foreign_key :team_2_id, :teams column :bracket_position, Integer column :winner_team_id, Integer column :loser_team_id, Integer end add_index :bracket_matchups, [:event_id, :round_id, :bracket_position], unique: true end end