Browse Source

fix: provide an option to skip base reordering while updating

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5718/head
Pranav C 1 year ago
parent
commit
49c2b8d424
  1. 4
      packages/nocodb/src/models/Base.ts
  2. 1
      packages/nocodb/src/version-upgrader/ncProjectConfigUpgrader.ts

4
packages/nocodb/src/models/Base.ts

@ -91,6 +91,7 @@ export default class Base implements BaseType {
base: BaseType & { base: BaseType & {
id: string; id: string;
projectId: string; projectId: string;
skipReorder?: boolean;
}, },
ncMeta = Noco.ncMeta, ncMeta = Noco.ncMeta,
) { ) {
@ -144,7 +145,8 @@ export default class Base implements BaseType {
// call before reorder to update cache // call before reorder to update cache
const returnBase = await this.get(oldBase.id, ncMeta); const returnBase = await this.get(oldBase.id, ncMeta);
await this.reorderBases(base.projectId, returnBase.id, ncMeta); if (!base.skipReorder)
await this.reorderBases(base.projectId, returnBase.id, ncMeta);
return returnBase; return returnBase;
} }

1
packages/nocodb/src/version-upgrader/ncProjectConfigUpgrader.ts

@ -42,6 +42,7 @@ export default async function ({ ncMeta }: NcUpgraderCtx) {
id: base.id, id: base.id,
projectId: base.project_id, projectId: base.project_id,
config, config,
skipReorder: true,
}, },
ncMeta, ncMeta,
), ),

Loading…
Cancel
Save