Merge pull request #810 from Tria-plc/alpha

fix: add partial WHERE clause to JourneySegment unique index migration
This commit is contained in:
robiman
2026-07-19 17:15:40 +03:00
committed by GitHub

View File

@@ -15,6 +15,7 @@ WHERE id NOT IN (
)
AND "seatId" IS NOT NULL;
-- CreateIndex
-- CreateIndex (partial: only index rows where seatId is not null so NULL rows never collide)
CREATE UNIQUE INDEX IF NOT EXISTS "JourneySegment_scheduleId_seatId_departureStationId_key"
ON "JourneySegment"("scheduleId", "seatId", "departureStationId");
ON passenger."JourneySegment"("scheduleId", "seatId", "departureStationId")
WHERE ("seatId" IS NOT NULL);