mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
Added support for MySQL
* In packages/cli/src/Db.ts, conditional test of dbType replaced by a switch; * removeAll() function adapted to not cause an error using MySQL; * Added the cross-env module in the "serve" script in the packages/editor-ui/package.json file. This was done to ensure compatibility between platforms when declaring environment variables. Without it, Windows compilation would give an error, for example; * .idea added to .gitignore (IntelliJ IDEA solutions);
This commit is contained in:
@@ -208,26 +208,32 @@ export class TestWebhooks {
|
||||
}
|
||||
const nodeTypes = NodeTypes();
|
||||
|
||||
const findQuery = {
|
||||
where: {
|
||||
id: findIn(this.activeWebhooks.getWorkflowIds())
|
||||
},
|
||||
} as FindManyOptions;
|
||||
/*
|
||||
* Here I check first if WorkflowIds is empty. This is done because when entering an empty array for TypeORM's In option, a syntax error is generated in MySQL.
|
||||
* Because the SQL is: ... FROM `workflow_entity`` WorkflowEntity` WHERE `WorkflowEntity`.`id` IN ()
|
||||
*
|
||||
* The empty IN function is not accepted in MySQL.
|
||||
*/
|
||||
const WorkflowIds = this.activeWebhooks.getWorkflowIds();
|
||||
if (WorkflowIds.length > 0) {
|
||||
const findQuery = {
|
||||
where: {
|
||||
id: findIn(WorkflowIds)
|
||||
},
|
||||
} as FindManyOptions;
|
||||
|
||||
const workflowsDb = await Db.collections.Workflow!.find(findQuery);
|
||||
const workflows: Workflow[] = [];
|
||||
for (const workflowData of workflowsDb) {
|
||||
const workflow = new Workflow(workflowData.id.toString(), workflowData.nodes, workflowData.connections, workflowData.active, nodeTypes, workflowData.staticData, workflowData.settings);
|
||||
workflows.push(workflow);
|
||||
const workflowsDb = await Db.collections.Workflow!.find(findQuery);
|
||||
const workflows: Workflow[] = [];
|
||||
for (const workflowData of workflowsDb) {
|
||||
const workflow = new Workflow(workflowData.id.toString(), workflowData.nodes, workflowData.connections, workflowData.active, nodeTypes, workflowData.staticData, workflowData.settings);
|
||||
workflows.push(workflow);
|
||||
}
|
||||
|
||||
return this.activeWebhooks.removeAll(workflows);
|
||||
}
|
||||
|
||||
return this.activeWebhooks.removeAll(workflows);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
let testWebhooksInstance: TestWebhooks | undefined;
|
||||
|
||||
export function getInstance(): TestWebhooks {
|
||||
|
||||
Reference in New Issue
Block a user