From be8f5618c616966b41b746e90980c40649db8e39 Mon Sep 17 00:00:00 2001 From: Till JS Date: Thu, 23 Apr 2026 15:36:18 +0200 Subject: [PATCH] chore(setup:db): surface drizzle-kit errors instead of catch-all push_schema used to print "Failed (may not have db:push script)" for every non-zero exit, lumping real failures (stuck rename prompts, pre-existing public enums) in with missing scripts. Now it prints the real exit code and tails the last 5 lines of drizzle-kit output so the root cause is visible without re-running by hand. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/setup-databases.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/setup-databases.sh b/scripts/setup-databases.sh index 711d80bdd..03f652eb0 100755 --- a/scripts/setup-databases.sh +++ b/scripts/setup-databases.sh @@ -64,7 +64,13 @@ push_schema() { elif [ $exit_code -eq 0 ]; then echo -e " ${GREEN}✓ Schema pushed${NC}" else - echo -e " ${RED}✗ Failed (may not have db:push script)${NC}" + # Real failure (push script exists but exit ≠ 0). Surface the last + # lines of drizzle-kit output so the root cause is visible without + # re-running by hand. Common cases: interactive rename prompt on + # stdin-less invocation, or pre-existing public-schema enums the + # service's schemaFilter hides. + echo -e " ${RED}✗ Schema push failed (exit ${exit_code})${NC}" + echo "$output" | tail -5 | sed 's/^/ /' fi }