diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f3a4cbd0..c1e6f765 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -141,8 +141,13 @@ rm -f "${BOT_ENV}" echo "Waiting for backend to start..." sleep 15 -# Code-only deployment: never mutate stage or production data here. -# Schema migrations and seed require a separate, explicitly authorized operation. +# Apply committed Prisma migrations as part of the CI/CD deployment. +# This is intentionally migrate deploy (not db push): it is repeatable, +# fail-closed, and applies only migrations already reviewed and committed. +echo "Applying committed database migrations..." +docker exec "${CONTAINER_PREFIX}" npx prisma migrate deploy + +# Code-only deployment: seed and destructive data changes are not performed here. # Auto-cleanup old docker builder cache to keep disk healthy (keeps latest 6GB) echo "Cleaning up old docker build cache..."