mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
add check for arr
This commit is contained in:
parent
43a91b8bd3
commit
40a43f5957
|
@ -20,6 +20,9 @@ export class AddNodeIds1658932910559 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = workflow.nodes;
|
const nodes = workflow.nodes;
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
nodes.forEach((node) => {
|
nodes.forEach((node) => {
|
||||||
if (!node.id) {
|
if (!node.id) {
|
||||||
|
@ -55,6 +58,9 @@ export class AddNodeIds1658932910559 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = workflow.nodes;
|
const nodes = workflow.nodes;
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
nodes.forEach((node) => delete node.id );
|
nodes.forEach((node) => delete node.id );
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,10 @@ export class AddNodeIds1658932090381 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = workflow.nodes;
|
const nodes = workflow.nodes;
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
nodes.forEach((node) => {
|
nodes.forEach((node) => {
|
||||||
if (!node.id) {
|
if (!node.id) {
|
||||||
|
@ -67,6 +71,10 @@ export class AddNodeIds1658932090381 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = workflow.nodes;
|
const nodes = workflow.nodes;
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
nodes.forEach((node) => delete node.id );
|
nodes.forEach((node) => delete node.id );
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,10 @@ export class AddNodeIds1658930531669 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = JSON.parse(workflow.nodes);
|
const nodes = JSON.parse(workflow.nodes);
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nodes.forEach((node: INode) => {
|
nodes.forEach((node: INode) => {
|
||||||
if (!node.id) {
|
if (!node.id) {
|
||||||
node.id = uuid();
|
node.id = uuid();
|
||||||
|
@ -61,6 +65,10 @@ export class AddNodeIds1658930531669 implements MigrationInterface {
|
||||||
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
await runChunked(queryRunner, workflowsQuery, (workflows) => {
|
||||||
workflows.forEach(async (workflow) => {
|
workflows.forEach(async (workflow) => {
|
||||||
const nodes = JSON.parse(workflow.nodes);
|
const nodes = JSON.parse(workflow.nodes);
|
||||||
|
if (!Array.isArray(nodes)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
nodes.forEach((node) => delete node.id );
|
nodes.forEach((node) => delete node.id );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue