fix(generate): recognize NUMBER columns as numeric

Closes #5283
This commit is contained in:
t8y2 committed 2026-08-13 11:33:55 +00:00
1 parent b38e30cd7f
commit 8b02ba003b
2 files changed
+11 -2

No files matched your search

@@ -1166,7 +1166,7 @@ const KnownColumnPatterns: Array<{ pattern: RegExp; generatorKey: string }> = [
export function findGeneratorKey(columnName: string, dataType: string, isAutoIncrement?: boolean): string {
if (isAutoIncrement) return "sequence";
const type = dataType.toLowerCase();
const isNumeric = type.includes("int") || type === "smallint" || type === "bigint" || type.includes("bool") || type.includes("decimal") || type.includes("numeric") || type.includes("float") || type.includes("double") || type === "real";
const isNumeric = /^number(?:\s*\([^)]*\))?$/.test(type.trim()) || type.includes("int") || type === "smallint" || type === "bigint" || type.includes("bool") || type.includes("decimal") || type.includes("numeric") || type.includes("float") || type.includes("double") || type === "real";
const isDateTime = type.includes("date") || type.includes("timestamp") || type === "time";
const isBinary = type.includes("binary") || type.includes("blob") || type.includes("bytea");
const isBoolType = type === "bool" || type === "boolean" || type === "bit" || type === "tinyint(1)";