From 588ed084ddca7d5f009255d8c4378da6d2c9c831 Mon Sep 17 00:00:00 2001 From: ssw Date: Mon, 22 Jun 2026 20:46:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(dm):=20v0.11=20=E7=A7=BB=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=20schema=20=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P0 清理(与后端 Java 实体对齐): - tableInfo: 移除 primaryKeyPolicy/logicalDelete/concurrencyLock (DbTableForm.java 仅有 table/tableName/newTable) - tableFieldList: 移除每字段 index 字段 (DbFieldVO.java 无此字段) 回归验证: TS 编译通过 (仅 tests/e2e/ 旧错误与本次无关) Co-Authored-By: Claude --- src/commands/dm/create.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/commands/dm/create.ts b/src/commands/dm/create.ts index fc46afc..50371e5 100644 --- a/src/commands/dm/create.ts +++ b/src/commands/dm/create.ts @@ -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系统列)`)