Files

16 lines
475 B
Bash
Raw Permalink Normal View History

#!/bin/sh
set -e
echo "Applying database migrations..."
if ! npx prisma migrate deploy; then
# An existing database from the old `db push` days has tables but no
# migration history (P3005). Baseline it: mark the init migration as
# already applied, then deploy the rest.
echo "Migrate deploy failed - attempting to baseline existing database..."
npx prisma migrate resolve --applied 0_init
npx prisma migrate deploy
fi
echo "Starting server..."
node server.js