Commit 19b137f9 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: drop player_id FK constraint — bots don't exist in profiles table

tournament_registrations.player_id had FK to profiles(id) which rejected
bot player inserts since bot UUIDs aren't real profiles. Dropped the
constraint so bot testing works.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 66dc5b71
-- Migration 005: Bot Tournament Testing
-- Adds is_bot flag to tournament_registrations for test player identification
-- Adds swiss_round_id to el3ab_tournament_rounds for linking to Swiss API rounds
-- Drops player_id FK to profiles (bots don't exist in profiles)
ALTER TABLE tournament_registrations
ADD COLUMN IF NOT EXISTS is_bot BOOLEAN DEFAULT FALSE,
......@@ -9,5 +10,8 @@ ALTER TABLE tournament_registrations
CREATE INDEX IF NOT EXISTS idx_tournament_registrations_bot
ON tournament_registrations(tournament_id) WHERE is_bot = TRUE;
ALTER TABLE tournament_registrations
DROP CONSTRAINT IF EXISTS tournament_registrations_player_id_fkey;
ALTER TABLE el3ab_tournament_rounds
ADD COLUMN IF NOT EXISTS swiss_round_id UUID;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment