diff --git a/packages/plugins/@nocobase/plugin-workflow/src/server/migrations/20231024172342-add-node-key.ts b/packages/plugins/@nocobase/plugin-workflow/src/server/migrations/20231024172342-add-node-key.ts index b103dbbe00..d155dfe7f9 100644 --- a/packages/plugins/@nocobase/plugin-workflow/src/server/migrations/20231024172342-add-node-key.ts +++ b/packages/plugins/@nocobase/plugin-workflow/src/server/migrations/20231024172342-add-node-key.ts @@ -28,11 +28,12 @@ export default class extends Migration { } const { db } = this.context; - const NodeRepo = db.getRepository('flow_nodes'); - const { key } = await this.queryInterface.describeTable('flow_nodes'); + const NodeCollection = db.getCollection('flow_nodes'); + const NodeRepo = NodeCollection.repository; + const tableName = NodeCollection.getTableNameWithSchema(); await db.sequelize.transaction(async (transaction) => { - if (!key) { - await this.queryInterface.addColumn('flow_nodes', 'key', DataTypes.STRING, { + if (!(await NodeCollection.getField('key').existsInDb())) { + await this.queryInterface.addColumn(tableName, 'key', DataTypes.STRING, { transaction, }); }