diff --git a/apps/edr-passenger-api/prisma/migrations/20260719000002_repair_route_checkin_minutes/migration.sql b/apps/edr-passenger-api/prisma/migrations/20260719000002_repair_route_checkin_minutes/migration.sql new file mode 100644 index 000000000..71005c8ea --- /dev/null +++ b/apps/edr-passenger-api/prisma/migrations/20260719000002_repair_route_checkin_minutes/migration.sql @@ -0,0 +1,10 @@ +-- Repair: add Route.checkinMinutesBefore and RouteStop.checkinMinutesBefore. +-- Migrations 20260717000001 and 20260717000002 were marked as "applied directly" +-- with empty SQL files, so these columns were never added to the deployed database. +-- P2022 (column does not exist) on Route.checkinMinutesBefore causes every +-- POST /search to fail with 500. +-- Uses IF NOT EXISTS so this migration is safe to run on databases where the +-- columns already exist. + +ALTER TABLE passenger."Route" ADD COLUMN IF NOT EXISTS "checkinMinutesBefore" INTEGER NOT NULL DEFAULT 30; +ALTER TABLE passenger."RouteStop" ADD COLUMN IF NOT EXISTS "checkinMinutesBefore" INTEGER;