init
This commit is contained in:
parent
8f9e16df7b
commit
7e6e46bb4a
@ -11,9 +11,13 @@ module.exports = {
|
||||
'numeric': 'DECIMAL',
|
||||
'varchar': 'VARCHAR',
|
||||
'timestamp': 'TIMESTAMP',
|
||||
'timestamptz': 'TIMESTAMP', // PostgreSQL timestamp with time zone
|
||||
'bool': 'BIT',
|
||||
'text': 'TEXT',
|
||||
'bytea': 'BLOB'
|
||||
'bytea': 'BLOB',
|
||||
'float8': 'DOUBLE', // PostgreSQL double precision
|
||||
'float4': 'REAL', // PostgreSQL real/float
|
||||
'float': 'REAL' // 通用float
|
||||
},
|
||||
|
||||
// 序列DEFAULT值转换规则
|
||||
|
||||
@ -43,8 +43,8 @@ class PG2DMConverter {
|
||||
convertDataTypes(sql) {
|
||||
let converted = sql;
|
||||
|
||||
// 1. 转换基本类型
|
||||
const typePattern = /\b(int8|int4|int2|numeric|bool)\b/gi;
|
||||
// 1. 转换基本类型(包括浮点类型和时间戳类型)
|
||||
const typePattern = /\b(int8|int4|int2|numeric|bool|float8|float4|float|timestamptz)\b/gi;
|
||||
|
||||
converted = converted.replace(typePattern, (match) => {
|
||||
const lowerMatch = match.toLowerCase();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user