Commit bcb98f4bbe570b7a1d8749688abb7e5519900e94

Authored by Ken
1 parent 7c397bbf

fix(SQL转换): 修正转postgresql时出现的类型不匹配.

Showing 1 changed file with 4 additions and 2 deletions
sql/tools/convertor.py
... ... @@ -411,7 +411,7 @@ class PostgreSQLConvertor(Convertor):
411 411  
412 412 type = type.lower()
413 413  
414   - if type == "varchar":
  414 + if type in ("varchar", "char"):
415 415 return f"varchar({size})"
416 416 if type in ("int", "int unsigned", "int unsigned zerofill"):
417 417 return "int4"
... ... @@ -425,13 +425,15 @@ class PostgreSQLConvertor(Convertor):
425 425 return "date"
426 426 if type == "json":
427 427 return "jsonb"
  428 + if type == "time":
  429 + return "time"
428 430 if type == "double":
429 431 return "double precision"
430 432 if type == "timestamp":
431 433 return f"timestamp({size})" if size else "timestamp"
432 434 if type == "bit":
433 435 return "bool"
434   - if type in ("text", "longtext"):
  436 + if type in ("text", "longtext", "mediumtext"):
435 437 return "text"
436 438 if type in ("blob", "mediumblob", "longblob"):
437 439 return "bytea"
... ...