Commit b5c2a185b8976b782fd2f7fa757e1265bf0486bd

Authored by DevDengChao
1 parent ec268831

feat: 允许通过参数转换自定义数据库脚本文件

Showing 1 changed file with 7 additions and 1 deletions
sql/tools/convertor.py
... ... @@ -919,9 +919,15 @@ def main():
919 919 help="目标数据库类型",
920 920 choices=["postgres", "oracle", "sqlserver", "dm8", "kingbase", "opengauss"],
921 921 )
  922 + parser.add_argument(
  923 + "path",
  924 + type=str,
  925 + help="源数据库脚本路径",
  926 + default="../mysql/ruoyi-vue-pro.sql"
  927 + )
922 928 args = parser.parse_args()
923 929  
924   - sql_file = pathlib.Path("../mysql/ruoyi-vue-pro.sql").resolve().as_posix()
  930 + sql_file = pathlib.Path(arg.path).resolve().as_posix()
925 931 convertor = None
926 932 if args.type == "postgres":
927 933 convertor = PostgreSQLConvertor(sql_file)
... ...