diff --git a/packages/nocodb/src/meta/meta.service.ts b/packages/nocodb/src/meta/meta.service.ts index 5074883b7d..d5bfbef9ba 100644 --- a/packages/nocodb/src/meta/meta.service.ts +++ b/packages/nocodb/src/meta/meta.service.ts @@ -1,16 +1,17 @@ -import { Injectable, Optional } from '@nestjs/common'; -import { customAlphabet } from 'nanoid'; +import {Injectable, Optional} from '@nestjs/common'; +import {customAlphabet} from 'nanoid'; import CryptoJS from 'crypto-js'; import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; -import type { Knex } from 'knex'; import type * as knex from 'knex'; +import type {Knex} from 'knex'; import XcMigrationSource from '~/meta/migrations/XcMigrationSource'; import XcMigrationSourcev2 from '~/meta/migrations/XcMigrationSourcev2'; -import { XKnex } from '~/db/CustomKnex'; -import { NcConfig } from '~/utils/nc-config'; -import { MetaTable } from '~/utils/globals'; +import {XKnex} from '~/db/CustomKnex'; +import {NcConfig} from '~/utils/nc-config'; +import {MetaTable} from '~/utils/globals'; + dayjs.extend(utc); dayjs.extend(timezone); @@ -215,6 +216,15 @@ export class MetaService { case MetaTable.KANBAN_VIEW_COLUMNS: prefix = 'kvc'; break; + case MetaTable.CALENDAR_VIEW: + prefix = 'cv'; + break; + case MetaTable.CALENDAR_VIEW_COLUMNS: + prefix = 'cvc'; + break; + case MetaTable.CALENDAR_VIEW_RANGE: + prefix = 'cvr'; + break; case MetaTable.USERS: prefix = 'us'; break; diff --git a/packages/nocodb/src/models/CalendarView.ts b/packages/nocodb/src/models/CalendarView.ts index 4914406e0c..eb0fbc7ecd 100644 --- a/packages/nocodb/src/models/CalendarView.ts +++ b/packages/nocodb/src/models/CalendarView.ts @@ -33,7 +33,7 @@ export default class CalendarView implements CalendarType { CacheGetType.TYPE_OBJECT, )); if (!view) { - view = await ncMeta.metaGet2(null, null, MetaTable.CALENDAR, { + view = await ncMeta.metaGet2(null, null, MetaTable.CALENDAR_VIEW, { fk_view_id: viewId, }); await NocoCache.set(`${CacheScope.CALENDAR_VIEW}:${viewId}`, view); @@ -57,7 +57,7 @@ export default class CalendarView implements CalendarType { insertObj.source_id = viewRef.source_id; } - await ncMeta.metaInsert2(null, null, MetaTable.CALENDAR, insertObj, true); + await ncMeta.metaInsert2(null, null, MetaTable.CALENDAR_VIEW, insertObj, true); return this.get(view.fk_view_id, ncMeta); } @@ -96,7 +96,7 @@ export default class CalendarView implements CalendarType { }*/ // update meta - return await ncMeta.metaUpdate(null, null, MetaTable.CALENDAR, updateObj, { + return await ncMeta.metaUpdate(null, null, MetaTable.CALENDAR_VIEW, updateObj, { fk_view_id: calendarId, }); } diff --git a/packages/nocodb/src/utils/globals.ts b/packages/nocodb/src/utils/globals.ts index 2fa6deafd6..039b99155c 100644 --- a/packages/nocodb/src/utils/globals.ts +++ b/packages/nocodb/src/utils/globals.ts @@ -21,7 +21,7 @@ export enum MetaTable { FORM_VIEW_COLUMNS = 'nc_form_view_columns_v2', GALLERY_VIEW = 'nc_gallery_view_v2', GALLERY_VIEW_COLUMNS = 'nc_gallery_view_columns_v2', - CALENDAR = 'nc_calendar_view_v2', + CALENDAR_VIEW = 'nc_calendar_view_v2', CALENDAR_VIEW_COLUMNS = 'nc_calendar_view_columns_v2', CALENDAR_VIEW_RANGE = 'nc_calendar_view_range_v2', GRID_VIEW = 'nc_grid_view_v2', @@ -67,7 +67,7 @@ export const orderedMetaTables = [ MetaTable.MAP_VIEW_COLUMNS, MetaTable.KANBAN_VIEW_COLUMNS, MetaTable.KANBAN_VIEW, - MetaTable.CALENDAR, + MetaTable.CALENDAR_VIEW, MetaTable.CALENDAR_VIEW_COLUMNS, MetaTable.CALENDAR_VIEW_RANGE, MetaTable.GRID_VIEW_COLUMNS,