# X_DB_DRIFT

## Means

schema differs from migrations

## Typical cause

a column exists in code but in no migration — or, on an app that declares an entity and has generated no migration yet, `packages/db has a schema but no migration recorded it`. An app declaring **no** entity is not drifting: zero declared against zero recorded is agreement. `As of 2026-11-02` also `the dump holds a column no migration's snapshot records` (`drift`, no database): an applied migration was edited and regenerated into `packages/db/schema/`

## Fix

`x db gen "<describe the change>"` then `x db migrate`; on a fresh scaffold that is `x db gen "initial"`. A column no entity declares comes out of that as an empty diff: declare it, or restore the migration and `x db reset`. The dump case: `git checkout -- packages/db/migrations packages/db/schema`. The one difference this does **not** fix is `unknown-schema` — see `X_MIGRATION_SNAPSHOT_MISSING` below, whose two remedies it shares

[Entity and database](/error-codes#entity-and-database)
