Files
CosmicClash/server/migrations/0005_proposal_match_plans.sql
T
2026-09-01 10:29:50 +01:00

16 lines
713 B
SQL

-- Preserve the matcher-selected topology through the proposal response window.
-- These fields are nullable for already-created proposals during a rolling
-- deployment; new matcher-created proposals always populate them before they
-- can be promoted to an ALLOCATING match.
ALTER TABLE proposals
ADD COLUMN match_region TEXT CHECK (match_region IN ('EU', 'NA')),
ADD COLUMN match_protocol INTEGER CHECK (match_protocol > 0);
ALTER TABLE proposal_participants
ADD COLUMN team INTEGER CHECK (team IN (0, 1)),
ADD COLUMN slot INTEGER CHECK (slot BETWEEN 0 AND 5);
CREATE UNIQUE INDEX proposal_participants_unique_slot
ON proposal_participants (proposal_id, slot)
WHERE slot IS NOT NULL;