diff --git a/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts b/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts index 193f614d49..ebf48b75da 100644 --- a/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts +++ b/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts @@ -12,6 +12,7 @@ import ncDataTypesUpgrader from './ncDataTypesUpgrader'; import ncProjectUpgraderV2_0090000 from './ncProjectUpgraderV2_0090000'; import ncProjectEnvUpgrader0011045 from './ncProjectEnvUpgrader0011045'; import ncProjectEnvUpgrader from './ncProjectEnvUpgrader'; +import ncHookUpgrader from './ncHookUpgrader'; import type { NcConfig } from '../../interface/config'; import type NcMetaIO from '../meta/NcMetaIO'; @@ -46,6 +47,7 @@ export default class NcUpgrader { { name: '0104004', handler: ncFilterUpgrader_0104004 }, { name: '0105002', handler: ncStickyColumnUpgrader }, { name: '0105003', handler: ncFilterUpgrader_0105003 }, + { name: '0105004', handler: ncHookUpgrader }, ]; if (!(await ctx.ncMeta.knexConnection?.schema?.hasTable?.('nc_store'))) { return; diff --git a/packages/nocodb/src/lib/version-upgrader/ncHookUpgrader.ts b/packages/nocodb/src/lib/version-upgrader/ncHookUpgrader.ts new file mode 100644 index 0000000000..41a842b4ea --- /dev/null +++ b/packages/nocodb/src/lib/version-upgrader/ncHookUpgrader.ts @@ -0,0 +1,13 @@ +import { MetaTable } from '../utils/globals'; +import type { NcUpgraderCtx } from './NcUpgrader'; + +export default async function ({ ncMeta }: NcUpgraderCtx) { + const actions = []; + const hooks = await ncMeta.metaList2(null, null, MetaTable.HOOKS); + for (const hook of hooks) { + actions.push( + ncMeta.metaUpdate(null, null, MetaTable.HOOKS, { version: 'v1' }, hook.id) + ); + } + await Promise.all(actions); +}