#!/bin/sh
set -e

echo "🔍 Checking for failed migrations..."

# Mark legacy migrations as applied
npx prisma migrate resolve --applied "20240100000000_fix_failed_migration_state" || true
npx prisma migrate resolve --applied "20240101000000_individual_tickets_no_timezone" || true
npx prisma migrate resolve --applied "20240102000000_drop_ticket_column_defaults" || true
npx prisma migrate resolve --applied "20241201000000_remove_station_timezone" || true
npx prisma migrate resolve --applied "20260101000000_add_configurable_fare_system" || true

echo "✅ Migration resolution complete"