fix(dm): v0.11 移除后端 schema 不存在的字段
P0 清理(与后端 Java 实体对齐): - tableInfo: 移除 primaryKeyPolicy/logicalDelete/concurrencyLock (DbTableForm.java 仅有 table/tableName/newTable) - tableFieldList: 移除每字段 index 字段 (DbFieldVO.java 无此字段) 回归验证: TS 编译通过 (仅 tests/e2e/ 旧错误与本次无关) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
86bf538f3e
commit
588ed084dd
1 file changed
+12
-16
+12
-16
@@ -72,23 +72,22 @@ export function buildDmCreateCommand(): Command {
|
||||
autoIncrement: 0,
|
||||
identity: 0,
|
||||
primaryKey: 0,
|
||||
index: '0',
|
||||
columnName: f.field,
|
||||
...f,
|
||||
}))
|
||||
// v10.6+ JNPF runtime 要求 9 系统列 (硬编码 SQL 引用) + 复合主键
|
||||
const sysCols = [
|
||||
{ field: 'f_id', fieldName: '主键', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_id', index: '0' },
|
||||
{ field: 'f_tenant_id', fieldName: '租户id', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_tenant_id', index: '0' },
|
||||
{ field: 'f_flow_task_id', fieldName: '流程任务ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_task_id', index: '0' },
|
||||
{ field: 'f_flow_id', fieldName: '流程ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_id', index: '0' },
|
||||
{ field: 'f_flow_state', fieldName: '流程状态', dataType: 'int', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_state', index: '0' },
|
||||
{ field: 'f_sort_code', fieldName: '排序', dataType: 'bigint', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_sort_code', index: '0' },
|
||||
{ field: 'f_create_user', fieldName: '创建人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_user', index: '0' },
|
||||
{ field: 'f_create_time', fieldName: '创建时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_time', index: '0' },
|
||||
{ field: 'f_modify_user', fieldName: '修改人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_user', index: '0' },
|
||||
{ field: 'f_modify_time', fieldName: '修改时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_time', index: '0' },
|
||||
{ field: 'f_description', fieldName: '描述', dataType: 'text', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_description', index: '0' },
|
||||
{ field: 'f_id', fieldName: '主键', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_id' },
|
||||
{ field: 'f_tenant_id', fieldName: '租户id', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_tenant_id' },
|
||||
{ field: 'f_flow_task_id', fieldName: '流程任务ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_task_id' },
|
||||
{ field: 'f_flow_id', fieldName: '流程ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_id' },
|
||||
{ field: 'f_flow_state', fieldName: '流程状态', dataType: 'int', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_state' },
|
||||
{ field: 'f_sort_code', fieldName: '排序', dataType: 'bigint', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_sort_code' },
|
||||
{ field: 'f_create_user', fieldName: '创建人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_user' },
|
||||
{ field: 'f_create_time', fieldName: '创建时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_time' },
|
||||
{ field: 'f_modify_user', fieldName: '修改人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_user' },
|
||||
{ field: 'f_modify_time', fieldName: '修改时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_time' },
|
||||
{ field: 'f_description', fieldName: '描述', dataType: 'text', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_description' },
|
||||
]
|
||||
const allFields = [...fields, ...sysCols]
|
||||
// JNPF dmpost body 结构: { tableInfo:{...}, tableFieldList:[...] }
|
||||
@@ -97,10 +96,7 @@ export function buildDmCreateCommand(): Command {
|
||||
table: opts.table,
|
||||
tableName: opts.tableName,
|
||||
newTable: opts.table,
|
||||
primaryKeyPolicy: 1,
|
||||
logicalDelete: false,
|
||||
concurrencyLock: false,
|
||||
},
|
||||
},
|
||||
tableFieldList: allFields,
|
||||
}
|
||||
log.info(`POST /system/DataModel/${dbLinkId}/Table table=${opts.table} fields=${allFields.length} (含9系统列)`)
|
||||
|
||||
Reference in new issue
Block a user