1. 扩展 SQL 转换工具的达梦支持
2. 补全除系统基础模块外额外功能模块 sql 脚本
3. 统一设置测试环境 xxl job 配置
(cherry picked from commit 6575e92757)
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -24,7 +24,7 @@
|
|||||||
<!-- <module>yudao-module-mall</module>-->
|
<!-- <module>yudao-module-mall</module>-->
|
||||||
<module>yudao-module-crm</module>
|
<module>yudao-module-crm</module>
|
||||||
<module>yudao-module-erp</module>
|
<module>yudao-module-erp</module>
|
||||||
<module>yudao-module-ai</module>
|
<!-- <module>yudao-module-ai</module>-->
|
||||||
<module>yudao-module-template</module>
|
<module>yudao-module-template</module>
|
||||||
<!-- <module>yudao-module-iot</module>-->
|
<!-- <module>yudao-module-iot</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
430
sql/mysql/ai.sql
Normal file
430
sql/mysql/ai.sql
Normal file
File diff suppressed because one or more lines are too long
508
sql/mysql/bpm.sql
Normal file
508
sql/mysql/bpm.sql
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
605
sql/mysql/crm.sql
Normal file
605
sql/mysql/crm.sql
Normal file
File diff suppressed because one or more lines are too long
1072
sql/mysql/erp.sql
Normal file
1072
sql/mysql/erp.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -631,10 +631,10 @@ GO
|
|||||||
-- @formatter:off
|
-- @formatter:off
|
||||||
BEGIN TRANSACTION
|
BEGIN TRANSACTION
|
||||||
GO
|
GO
|
||||||
SET IDENTITY_INSERT {table_name.lower()} ON
|
-- SET IDENTITY_INSERT {table_name.lower()} ON
|
||||||
GO
|
GO
|
||||||
{inserts_lines}
|
{inserts_lines}
|
||||||
SET IDENTITY_INSERT {table_name.lower()} OFF
|
-- SET IDENTITY_INSERT {table_name.lower()} OFF
|
||||||
GO
|
GO
|
||||||
COMMIT
|
COMMIT
|
||||||
GO
|
GO
|
||||||
@@ -692,6 +692,12 @@ class DM8Convertor(Convertor):
|
|||||||
return "blob"
|
return "blob"
|
||||||
if type == "mediumblob":
|
if type == "mediumblob":
|
||||||
return "varchar(10240)"
|
return "varchar(10240)"
|
||||||
|
if type == "double":
|
||||||
|
return "double"
|
||||||
|
if type == "json":
|
||||||
|
return "clob"
|
||||||
|
if type == "longtext":
|
||||||
|
return "clob"
|
||||||
if type == "decimal":
|
if type == "decimal":
|
||||||
return (
|
return (
|
||||||
f"decimal({','.join(str(s) for s in size)})" if len(size) else "decimal"
|
f"decimal({','.join(str(s) for s in size)})" if len(size) else "decimal"
|
||||||
@@ -705,6 +711,9 @@ class DM8Convertor(Convertor):
|
|||||||
if name == "id":
|
if name == "id":
|
||||||
# 默认不生成自增,使用分布式 Id
|
# 默认不生成自增,使用分布式 Id
|
||||||
return "id bigint NOT NULL PRIMARY KEY "
|
return "id bigint NOT NULL PRIMARY KEY "
|
||||||
|
if name == "percent":
|
||||||
|
# percent 是 dm 保留关键字,需要用双引号包裹
|
||||||
|
return '"percent" decimal(24, 6) NOT NULL DEFAULT 0'
|
||||||
|
|
||||||
type = col["type"].lower()
|
type = col["type"].lower()
|
||||||
full_type = self.translate_type(type, col["size"])
|
full_type = self.translate_type(type, col["size"])
|
||||||
@@ -733,6 +742,10 @@ CREATE TABLE {table_name} (
|
|||||||
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
def gen_comment(self, table_sql: str, table_name: str) -> str:
|
||||||
script = ""
|
script = ""
|
||||||
for field, comment_string in self.filed_comments(table_sql):
|
for field, comment_string in self.filed_comments(table_sql):
|
||||||
|
# 存在 percent 关键字需要双引号包裹
|
||||||
|
if field.lower() == "percent":
|
||||||
|
script = script.replace(f'{table_name}.percent', f'{table_name}."percent"')
|
||||||
|
continue
|
||||||
script += (
|
script += (
|
||||||
f"COMMENT ON COLUMN {table_name}.{field} IS '{comment_string}';" + "\n"
|
f"COMMENT ON COLUMN {table_name}.{field} IS '{comment_string}';" + "\n"
|
||||||
)
|
)
|
||||||
@@ -762,12 +775,13 @@ CREATE TABLE {table_name} (
|
|||||||
-- Records of {table_name.lower()}
|
-- Records of {table_name.lower()}
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- @formatter:off
|
-- @formatter:off
|
||||||
SET IDENTITY_INSERT {table_name.lower()} ON;
|
-- SET IDENTITY_INSERT {table_name.lower()} ON;
|
||||||
{inserts_lines}
|
{inserts_lines}
|
||||||
COMMIT;
|
COMMIT;
|
||||||
SET IDENTITY_INSERT {table_name.lower()} OFF;
|
-- SET IDENTITY_INSERT {table_name.lower()} OFF;
|
||||||
-- @formatter:on"""
|
-- @formatter:on"""
|
||||||
|
script = script.replace(" percent,",' "percent",')
|
||||||
|
script = script.replace("\\'","''")
|
||||||
return script
|
return script
|
||||||
|
|
||||||
|
|
||||||
@@ -823,7 +837,7 @@ def main():
|
|||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
sql_file = pathlib.Path("../mysql/ruoyi-vue-pro.sql").resolve().as_posix()
|
sql_file = pathlib.Path("../mysql/ai.sql").resolve().as_posix()
|
||||||
convertor = None
|
convertor = None
|
||||||
if args.type == "postgres":
|
if args.type == "postgres":
|
||||||
convertor = PostgreSQLConvertor(sql_file)
|
convertor = PostgreSQLConvertor(sql_file)
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ public class BusinessBaseDO extends TenantBaseDO {
|
|||||||
/** 部门名称 */
|
/** 部门名称 */
|
||||||
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
|
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
|
||||||
private String deptName;
|
private String deptName;
|
||||||
/** 任务编号 */
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR)
|
|
||||||
private Long taskId;
|
|
||||||
/** 岗位编号 */
|
/** 岗位编号 */
|
||||||
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
|
@TableField(fill = FieldFill.INSERT, jdbcType = JdbcType.VARCHAR)
|
||||||
private Long postId;
|
private Long postId;
|
||||||
@@ -43,7 +40,6 @@ public class BusinessBaseDO extends TenantBaseDO {
|
|||||||
this.companyName = null;
|
this.companyName = null;
|
||||||
this.deptId = null;
|
this.deptId = null;
|
||||||
this.deptName = null;
|
this.deptName = null;
|
||||||
this.taskId = null;
|
|
||||||
this.postId = null;
|
this.postId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user