fix(workflow-action-trigger): change plugin name (#3631)

* fix(plugin-workflow-action-trigger): fix migration

* fix(plugin-workflow): fix useless migration logic
This commit is contained in:
Junyi 2024-03-06 16:36:35 +08:00 committed by GitHub
parent f9d1e9f0bc
commit b5ae9343b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 33 deletions

View File

@ -1,7 +1,7 @@
import { Migration } from '@nocobase/server'; import { Migration } from '@nocobase/server';
export default class extends Migration { export default class extends Migration {
appVersion = '<0.19.0-alpha.10'; appVersion = '<0.20.0-alpha.6';
on = 'afterSync'; on = 'afterSync';
async up() { async up() {
const { db } = this.context; const { db } = this.context;

View File

@ -9,40 +9,8 @@ export default class extends Migration {
} }
const { db } = this.context; const { db } = this.context;
const PluginModel = db.getModel('applicationPlugins');
const NodeRepo = db.getRepository('flow_nodes'); const NodeRepo = db.getRepository('flow_nodes');
await db.sequelize.transaction(async (transaction) => { await db.sequelize.transaction(async (transaction) => {
await [
'@nocobase/plugin-workflow-aggregate',
'@nocobase/plugin-workflow-delay',
'@nocobase/plugin-workflow-dynamic-calculation',
'@nocobase/plugin-workflow-loop',
'@nocobase/plugin-workflow-manual',
'@nocobase/plugin-workflow-parallel',
'@nocobase/plugin-workflow-request',
'@nocobase/plugin-workflow-sql',
'@nocobase/plugin-workflow-form-trigger',
].reduce(
(promise, packageName) =>
promise.then(async () => {
const existed = await PluginModel.findOne({ where: { packageName }, transaction });
if (!existed) {
await PluginModel.create(
{
name: packageName,
packageName,
version: '0.17.0-alpha.1',
enabled: true,
installed: true,
builtin: true,
},
{ transaction },
);
}
}),
Promise.resolve(),
);
const nodes = await NodeRepo.find({ const nodes = await NodeRepo.find({
transaction, transaction,
}); });