mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 tablePrefix = getTablePrefix();
|
||||||
|
|
||||||
const workflows: Array<{ id: number; nodes: INode[]; connections: IConnections }> =
|
const workflows: Array<{
|
||||||
await queryRunner.query(`
|
id: number;
|
||||||
|
nodes: INode[] | string;
|
||||||
|
connections: IConnections | string;
|
||||||
|
}> = await queryRunner.query(`
|
||||||
SELECT id, nodes, connections
|
SELECT id, nodes, connections
|
||||||
FROM \`${tablePrefix}workflow_entity\`
|
FROM \`${tablePrefix}workflow_entity\`
|
||||||
`);
|
`);
|
||||||
|
@ -21,8 +24,12 @@ export class PurgeInvalidWorkflowConnections1675940580449 implements MigrationIn
|
||||||
const nodeTypes = NodeTypes();
|
const nodeTypes = NodeTypes();
|
||||||
|
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
let connections: IConnections = workflow.connections;
|
let connections: IConnections =
|
||||||
const nodes: INode[] = workflow.nodes;
|
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) => {
|
const nodesThatCannotReceiveInput: string[] = nodes.reduce((acc, node) => {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue