Skip to content

nschema drift

Check whether the live database has drifted from the recorded state, reporting the difference as a diff (recorded → live, so an out-of-band change appears as an add and a manual drop as a remove). This is a pure observation: no transformers or policies run, so it never fails on a policy violation.

Terminal window
nschema drift
nschema drift --detailed-exitcode # CI/monitoring: exit 2 if the database has drifted
  • --scope <name> — limit the check to specific namespaces. May be repeated.
  • --detailed-exitcode — return a detailed exit code: 0 when there is no drift, 2 when the live database has drifted (errors stay 1), so a monitoring job can gate on it. Without it, drift exits 0 and you read the diff it prints.

See Detecting drift for how to use this in monitoring.