Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

preflight: these changes need confirming

A deploy that needs your say-so stopped, because nobody was at a terminal to answer.

Some schema changes can mean two things, and only you know which one you meant. A deploy asks before it makes one, and stops when nobody can answer.

Issue

A deploy from CI or a script lists the changes, marks one as confirm:, and exits with code 6. Renaming the text column of List to an optional label prints this.

Preflight for <ORG>/<PROJECT>:
  List: add column items.label (string, optional)
  List: drop column items.text
  warning: List: column items.text is no longer used; its data stays in each luna until a migration removes it
  dry run of List: <N> sampled, 0 failed
  confirm: List: items.text and items.label: is this a rename? Luna will add the new one and stop using the old one, without copying the data, unless onMigrate does
error: preflight: these changes need confirming, so nothing was deployed
  Pass --yes to go ahead.

At a terminal, the deploy asks Deploy anyway? [y/N] instead. Any answer but yes ends with preflight: nothing was deployed.

Cause

A table lost a column and gained another of the same type in one deploy. That looks like a rename, but Luna sees two separate changes. It adds the new column empty, and leaves the old column’s data unused.

Solution

If it is a rename, copy the data with an onMigrate hook on the luna type. Each luna runs it once as it moves to the new version, in one transaction with the schema change.

If you meant to drop one column and add an unrelated one, pass --yes to go ahead.

luna deploy --yes

Run luna deploy --preflight to see the changes again without deploying. Change a schema shows an onMigrate that copies a column.

Was this page helpful?