2026-06-30 08:58:13 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
2026-07-01 19:43:36 -05:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2026-06-30 08:58:13 -05:00
|
|
|
echo "Starting server..."
|
|
|
|
|
node server.js
|