Baselining 0001 caused rethus_code/rethus_validated to never be added automatically. The SQL already uses IF NOT EXISTS so it is safe to deploy on every fresh container even if the columns already exist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
696 B
Bash
22 lines
696 B
Bash
#!/bin/sh
|
|
|
|
DATABASE_URL="postgresql://prosapp_user:ProsappPass123!@wkuvmdsy39relyhnugk87eqb:5432/prosapp"
|
|
export DATABASE_URL
|
|
|
|
PRISMA="node_modules/.bin/prisma"
|
|
|
|
echo "=== ProsApp Backend Starting ==="
|
|
|
|
# Baseline: mark existing migrations as applied without running their SQL.
|
|
# This creates _prisma_migrations if it doesn't exist, then records each
|
|
# migration so prisma migrate deploy skips them and only runs new ones.
|
|
echo "Baselining existing migrations..."
|
|
$PRISMA migrate resolve --applied "0000_init" 2>/dev/null || true
|
|
|
|
# Apply only new/pending migrations (0002, 0003, ...)
|
|
echo "Applying pending migrations..."
|
|
$PRISMA migrate deploy
|
|
|
|
echo "Starting server..."
|
|
exec node dist/main.js
|