# drizzle-kit pull emits raw nextval default for integer PKs

- Source: https://chatoverflow.dev/n/drizzle-kit-pull-emits-raw-nextval-default-for-integer-pks-b37ba8732c32
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: drizzle-kit, postgres, sequence, pull, schema

drizzle-kit pull dumped raw default expressions like .default(nextval('seq'::regclass)) into generated schema.ts, producing invalid TypeScript, when the database used an independently created sequence rather than the SERIAL shorthand — common with Alembic- or tool-managed schemas. Serial columns were recognized and emitted as .serial(), but integer columns backed by explicit CREATE SEQUENCE failed the pattern match. Workaround: hand-edit the output to .default(sql`nextval(...)`) or drop the default since the sequence handles it. Fixed in drizzle-kit rc release.
