mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
refactor(plugin-workflow): change executions not to be deleted when workflow deleted (#5666)
* chore(ci): add retry * refactor(plugin-workflow): change executions not to be deleted when workflow deleted --------- Co-authored-by: xilesun <2013xile@gmail.com>
This commit is contained in:
parent
3dd6d6d5ef
commit
1f4802e20f
@ -2,9 +2,7 @@
|
||||
"version": "1.3.51",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"npmClientArgs": [
|
||||
"--ignore-engines"
|
||||
],
|
||||
"npmClientArgs": ["--ignore-engines"],
|
||||
"command": {
|
||||
"version": {
|
||||
"forcePublish": true,
|
||||
|
@ -18,12 +18,14 @@ describe('workflow > actions > workflows', () => {
|
||||
let PostModel;
|
||||
let PostRepo;
|
||||
let WorkflowModel;
|
||||
let ExecutionModel;
|
||||
|
||||
beforeEach(async () => {
|
||||
app = await getApp();
|
||||
agent = app.agent();
|
||||
db = app.db;
|
||||
WorkflowModel = db.getCollection('workflows').model;
|
||||
ExecutionModel = db.getCollection('executions').model;
|
||||
PostModel = db.getCollection('posts').model;
|
||||
PostRepo = db.getCollection('posts').repository;
|
||||
});
|
||||
@ -119,7 +121,7 @@ describe('workflow > actions > workflows', () => {
|
||||
});
|
||||
|
||||
describe('destroy', () => {
|
||||
it('cascading destroy all revisions, nodes, executions and jobs', async () => {
|
||||
it('cascading destroy all revisions, nodes, but not executions and jobs', async () => {
|
||||
const workflow = await WorkflowModel.create({
|
||||
enabled: true,
|
||||
type: 'collection',
|
||||
@ -172,8 +174,8 @@ describe('workflow > actions > workflows', () => {
|
||||
|
||||
const w2c = await WorkflowModel.count();
|
||||
expect(w2c).toBe(0);
|
||||
const e2c = await workflow.countExecutions();
|
||||
expect(e2c).toBe(0);
|
||||
const e2c = await ExecutionModel.count();
|
||||
expect(e2c).toBe(1);
|
||||
const n1c = await workflow.countNodes();
|
||||
expect(n1c).toBe(0);
|
||||
const n2c = await w2.countNodes();
|
||||
@ -182,7 +184,7 @@ describe('workflow > actions > workflows', () => {
|
||||
expect(p2c).toBe(1);
|
||||
|
||||
const j2c = await JobModel.count();
|
||||
expect(j2c).toBe(0);
|
||||
expect(j2c).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -57,7 +57,6 @@ export default function () {
|
||||
{
|
||||
type: 'hasMany',
|
||||
name: 'executions',
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
{
|
||||
type: 'integer',
|
||||
|
Loading…
x
Reference in New Issue
Block a user