Files
kycnotme/web/migrate.sh

20 lines
494 B
Bash
Raw Permalink Normal View History

2025-05-19 10:23:36 +00:00
#!/bin/sh
set -e
# Apply migrations
echo "Applying database migrations..."
npx prisma migrate deploy
# Apply triggers
echo "Applying database triggers..."
for trigger_file in prisma/triggers/*.sql; do
if [ -f "$trigger_file" ]; then
echo "Applying trigger: $trigger_file"
npx prisma db execute --file "$trigger_file" --schema=./prisma/schema.prisma
else
echo "No trigger files found in prisma/triggers/ or $trigger_file is not a file."
fi
done
2025-05-22 22:38:41 +00:00
echo "Migrations completed."