When migrate can't resolve itself: ambiguous renames
A rename drizzle-kit cannot infer becomes an interactive prompt, and with no terminal to answer it Kywi fails the migrate rather than let the change vanish.
One column gone and one column new is not enough information to tell a rename from a drop-and-add, so drizzle-kit asks. There is no terminal on the other end of a scripted migrate, and this is the message that ends the run:
✖ 'drizzle-kit generate' found an ambiguous schema change it can only resolve interactively (a possible rename) — and with no terminal attached to answer it, it wrote nothing. Run 'drizzle-kit generate' yourself in an interactive terminal to resolve the prompt, commit the resulting migration file, then re-run 'kywi migrate'.
(kywi-cms#141)Exit code 1, nothing applied, nothing written. Re-running produces it again: the test happens before the exit status is looked at, and the same schema against the same journal is the same ambiguity every time.
Why the exit code could not be trusted
Unanswered, the prompt resolves to nothing and drizzle-kit exits zero having written no migration for that change. So kywi migrate captures generate's output instead of letting it through, echoes it, and looks for the prompt's own wording rather than believing the status code. drizzle-kit's prompt is therefore in your log immediately above Kywi's error — the run failed on purpose, at the only moment the failure was still detectable.
Resolving it
Answer the prompt yourself, on the machine where you can see it. drizzle-kit generate diffs your schema files against its own snapshot and needs no database connection to do it — the migration file is what you are producing, not a schema change:
pnpm exec drizzle-kit generate # answer: created, or renamed from <old column>
git add kywi-generated/migrations && git commit -m 'migration: rename …'
pnpm exec kywi migrateThere is no flag that picks an answer for you — migrate takes only --config, --push and --force-push — and --push is refused outright on a journal-managed project, so it is not an escape hatch either (Why drizzle-kit push is banned before deploy). With the migration committed, the production run is the ordinary one: Running migrations against a live database.
Not hitting it in the first place
Plan the rename as three deploys instead of one — add the new field, backfill it, then drop the old one in a later migration, the same sequence Changing the content model on a database that has data gives for this exact rename. No diff is ever ambiguous, no deploy ever needs a terminal, and every intermediate state is a database both versions of the app can read, which a single renaming migration is not. That page also covers why a rename reaches drizzle-kit as a create plus a drop at all.