-- 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;
