Skip to content

Commit 4d057c6

Browse files
Revert "ci(migrations): fail dev schema push with an actionable error on rename/drop prompt"
This reverts commit 2626482.
1 parent 150b3fe commit 4d057c6

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

.github/workflows/migrations.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,7 @@ jobs:
6969
7070
if [ "${ENVIRONMENT}" = "dev" ]; then
7171
echo "Dev environment — pushing schema directly (db:push)"
72-
# `--force` only suppresses the data-loss confirm, not drizzle's
73-
# rename-vs-drop prompt, which fires (and crashes, no TTY) when a
74-
# diff both adds and drops tables/columns at once. Turn that opaque
75-
# crash into an actionable failure instead of a bare stack trace.
76-
push_output="$(bun run db:push --force 2>&1)" && push_status=0 || push_status=$?
77-
echo "$push_output"
78-
if [ "$push_status" -ne 0 ]; then
79-
if printf '%s' "$push_output" | grep -q 'Interactive prompts require a TTY'; then
80-
echo "::error title=Dev schema push needs manual reconciliation::drizzle-kit push hit an interactive rename/drop prompt that CI cannot answer. The dev DB has drifted from schema.ts: it still holds table(s)/column(s) the schema no longer declares while the schema also adds new ones, so drizzle cannot tell a rename from a drop+create. Fix: drop the stale objects on the dev DB to match schema.ts — the same DROPs the latest versioned migration already applied to staging/prod (grep packages/db/migrations for the most recent DROP TABLE / DROP COLUMN) — then re-run this workflow. --force cannot bypass this prompt."
81-
fi
82-
exit "$push_status"
83-
fi
72+
bun run db:push --force
8473
else
8574
echo "Applying versioned migrations (db:migrate)"
8675
bun run ./scripts/migrate.ts

0 commit comments

Comments
 (0)