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/sqlgenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ const parseType = (schemaPrefix: string, type: string) => {
const arrayDefinitionRegex = /\[\d*(?:\[\d*\])*\]/g;
const arrayDefinition = (type.match(arrayDefinitionRegex) ?? []).join('');
const withoutArrayDefinition = type.replace(arrayDefinitionRegex, '');
return pgNativeTypes.some((it) => type.startsWith(it))
return pgNativeTypes.some(
(it) =>
withoutArrayDefinition === it ||
withoutArrayDefinition.startsWith(it + '(') ||
withoutArrayDefinition.startsWith(it + ' '),
)
? `${withoutArrayDefinition}${arrayDefinition}`
: `${schemaPrefix}"${withoutArrayDefinition}"${arrayDefinition}`;
};
Expand Down