# X_MIGRATION_UNGENERATABLE

## Means

this migration holds SQL no declaration carries and does not say so

## Typical cause

the third rail of the `drift` step, and the one a **squash** discards. `x db gen` can only write what an entity declares, so a hand-written `CREATE TYPE … AS ENUM`, `CREATE EXTENSION`, `GRANT`, `ALTER TABLE … REPLICA IDENTITY FULL` or a data backfill is lost the moment anyone regenerates — and no declaration-based check can see it, because a regenerated sidecar equals the declaration by construction. `examples/dummy`'s `0001_init.sql` holds **7**: five enum types and both replica identities. A count, not a boolean, so the first hand-written statement does not buy that file an unlimited allowance

## Fix

add the header line `-- ungeneratable: <n>` to the file `packages/db/migrations/<id>.sql` that the finding names, so a squash carries these statements by hand — or re-declare what an entity *can* express (an enum is a text column plus a `check` invariant) and run `x db gen "<name>"`. Add the marker **before** the migration is applied: it is SQL the checksum covers, so marking an applied file answers `X_MIGRATION_CONFLICT`

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