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 #688 — makeEqlV3Column 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.
Summary
drizzle-kit generate/pushemits invalid DDL for EQL v3 encrypted columns. A v3 column declares its SQL type as the schema-qualified domainpublic.eql_v3_text_search, but drizzle-kit wraps acustomType's wholedataType()string in a single pair of double quotes: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. Apushdiff 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 viasearch_path(theeql_v3_*domains live inpublic, always in-path) — mirroring the v2encryptedTypesurface, which already emits its bare type for exactly this reason.Reproduction
Confirmed against
drizzle-kit@0.30.6viadrizzle-kit/apigenerateMigration: the qualified name produces"public.eql_v3_text_search"on both CREATE TABLE and ADD COLUMN.Resolution
Fixed in #688 —
makeEqlV3Columnnow emits the bare domain name viastripDomainSchema, with builder recovery (getSqlType()) re-qualifying back topublic.eql_v3_*so operators and schema extraction are unchanged.