|
|
@ -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}')`); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|