Browse Source

refactor: improved logs

pull/9684/head
Pranav C 4 weeks ago
parent
commit
f54b1e6273
  1. 7
      packages/nocodb/src/version-upgrader/upgraders/0227002_ncBrokenLinkRecovery.ts

7
packages/nocodb/src/version-upgrader/upgraders/0227002_ncBrokenLinkRecovery.ts

@ -3,7 +3,6 @@ import type { NcUpgraderCtx } from '~/version-upgrader/NcUpgrader';
import type { MetaService } from '~/meta/meta.service'; import type { MetaService } from '~/meta/meta.service';
import { MetaTable } from '~/utils/globals'; import { MetaTable } from '~/utils/globals';
import { Column } from '~/models'; import { Column } from '~/models';
import { parseMetaProp } from '~/utils/modelUtils';
import { isEE } from '~/utils'; import { isEE } from '~/utils';
/** /**
@ -35,7 +34,7 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
// Recover broken link // Recover broken link
for (const column of columns) { for (const column of columns) {
logger.log(`Recovering column '${column.title}' with id '${column.id}'`); logger.log(`Recovering column '${column.title}' (ID: '${column.id}')`);
let relatedTableId; let relatedTableId;
@ -279,7 +278,7 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
if (!foundAndMapped) { if (!foundAndMapped) {
logger.error( logger.error(
`Couldn't find any column which is related to the link column '${column.title}' with id '${column.id}'`, `No related column found for link column '${column.title}' (ID: '${column.id}'). Deleting it.`,
); );
// delete the link column since it's not useful anymore and not recoverable // delete the link column since it's not useful anymore and not recoverable
@ -291,6 +290,8 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
column.id, column.id,
ncMeta, ncMeta,
); );
} else {
logger.log(`Recovered column '${column.title}' (ID: '${column.id}')`);
} }
} }
} }

Loading…
Cancel
Save