Skip to content

drizzle-kit generate/push emits invalid DDL for EQL v3 encrypted columns #713

Description

@coderdan

Summary

drizzle-kit generate/push emits invalid DDL for EQL v3 encrypted columns. A v3 column declares its SQL type as the schema-qualified domain public.eql_v3_text_search, but drizzle-kit wraps a customType's whole dataType() string in a single pair of double quotes:

-- broken:
CREATE TABLE "users" (
  "email" "public.eql_v3_text_search"   -- one dotted identifier → type does not exist
);

Postgres reads "public.eql_v3_text_search" as a single type name containing a dot and rejects it (type "public.eql_v3_text_search" does not exist), so every generated migration needs hand repair. A push diff also surfaces the "undefined"."public.eql_v3_*" mismatch because the code side and introspected DB side disagree.

Expected

Generated DDL should reference the domain in a form Postgres accepts, e.g. the bare "eql_v3_text_search" resolving via search_path (the eql_v3_* domains live in public, always in-path) — mirroring the v2 encryptedType surface, which already emits its bare type for exactly this reason.

Reproduction

Confirmed against drizzle-kit@0.30.6 via drizzle-kit/api generateMigration: the qualified name produces "public.eql_v3_text_search" on both CREATE TABLE and ADD COLUMN.

Resolution

Fixed in #688makeEqlV3Column now emits the bare domain name via stripDomainSchema, with builder recovery (getSqlType()) re-qualifying back to public.eql_v3_* so operators and schema extraction are unchanged.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions