#!/bin/sh
set -e

echo "Running database migrations..."
prisma migrate deploy --schema=./prisma/schema.prisma 2>&1 || {
  echo "WARNING: Migration failed. Starting app anyway (migrations may already be applied)."
}

echo "Starting application..."
exec node server.js
