mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
fix: MySQL migration parses database contents if necessary (fix for MariaDB) (#5441)
This commit is contained in:
parent
b57ec1d6ab
commit
7fc96571e0
|
@ -12,8 +12,11 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
|
|||
|
||||
const tablePrefix = getTablePrefix();
|
||||
|
||||
const workflows: Array<{ id: number; nodes: INode[]; connections: IConnections }> =
|
||||
await queryRunner.query(`
|
||||
const workflows: Array<{
|
||||
id: number;
|
||||
nodes: INode[] | string;
|
||||
connections: IConnections | string;
|
||||
}> = await queryRunner.query(`
|
||||
SELECT id, nodes, connections
|
||||
FROM \`${tablePrefix}workflow_entity\`
|
||||
`);
|
||||
|
@ -21,8 +24,12 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
|
|||
const nodeTypes = NodeTypes();
|
||||
|
||||
workflows.forEach(async (workflow) => {
|
||||
let connections: IConnections = workflow.connections;
|
||||
const nodes: INode[] = workflow.nodes;
|
||||
let connections: IConnections =
|
||||
typeof workflow.connections === 'string'
|
||||
? JSON.parse(workflow.connections)
|
||||
: workflow.connections;
|
||||
const nodes: INode[] =
|
||||
typeof workflow.nodes === 'string' ? JSON.parse(workflow.nodes) : workflow.nodes;
|
||||
|
||||
const nodesThatCannotReceiveInput: string[] = nodes.reduce((acc, node) => {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue