Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drizzle-kit/src/serializer/pgSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,12 @@ const getColumnsInfoQuery = ({ schema, table, db }: { schema: string; table: str
ELSE format_type(a.atttypid, a.atttypmod)
END AS data_type, -- Column data type
-- ns.nspname AS type_schema, -- Schema name
pg_get_serial_sequence('"${schema}"."${table}"', a.attname)::regclass AS seq_name, -- Serial sequence (if any)
CASE
WHEN pg_get_serial_sequence('"${schema}"."${table}"', a.attname) LIKE '%.%' THEN
split_part(pg_get_serial_sequence('"${schema}"."${table}"', a.attname), '.', 2)
ELSE
pg_get_serial_sequence('"${schema}"."${table}"', a.attname)
END AS seq_name, -- Serial sequence (if any)
c.column_default, -- Column default value
c.data_type AS additional_dt, -- Data type from information_schema
c.udt_name AS enum_name, -- Enum type (if applicable)
Expand Down