fix(plugin-workflow): fix migration (#2927)
This commit is contained in:
parent
6f3681c2aa
commit
4bac9abbbb
@ -28,11 +28,12 @@ export default class extends Migration {
|
|||||||
}
|
}
|
||||||
const { db } = this.context;
|
const { db } = this.context;
|
||||||
|
|
||||||
const NodeRepo = db.getRepository('flow_nodes');
|
const NodeCollection = db.getCollection('flow_nodes');
|
||||||
const { key } = await this.queryInterface.describeTable('flow_nodes');
|
const NodeRepo = NodeCollection.repository;
|
||||||
|
const tableName = NodeCollection.getTableNameWithSchema();
|
||||||
await db.sequelize.transaction(async (transaction) => {
|
await db.sequelize.transaction(async (transaction) => {
|
||||||
if (!key) {
|
if (!(await NodeCollection.getField('key').existsInDb())) {
|
||||||
await this.queryInterface.addColumn('flow_nodes', 'key', DataTypes.STRING, {
|
await this.queryInterface.addColumn(tableName, 'key', DataTypes.STRING, {
|
||||||
transaction,
|
transaction,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user