Browse Source

feat(nocodb): add custom url table

Ramesh Mane 4 days ago
parent
commit
d79cd425ad
  1. 4
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  2. 28
      packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts
  3. 3
      packages/nocodb/src/utils/globals.ts

4
packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts

@ -55,6 +55,7 @@ import * as nc_065_encrypt_flag from '~/meta/migrations/v2/nc_065_encrypt_flag';
import * as nc_066_ai_button from '~/meta/migrations/v2/nc_066_ai_button'; import * as nc_066_ai_button from '~/meta/migrations/v2/nc_066_ai_button';
import * as nc_067_personal_view from '~/meta/migrations/v2/nc_067_personal_view'; import * as nc_067_personal_view from '~/meta/migrations/v2/nc_067_personal_view';
import * as nc_068_user_delete from '~/meta/migrations/v2/nc_068_user_delete'; import * as nc_068_user_delete from '~/meta/migrations/v2/nc_068_user_delete';
import * as nc_068_custom_url_table from '~/meta/migrations/v2/nc_068_custom_url_table';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -121,6 +122,7 @@ export default class XcMigrationSourcev2 {
'nc_066_ai_button', 'nc_066_ai_button',
'nc_067_personal_view', 'nc_067_personal_view',
'nc_068_user_delete', 'nc_068_user_delete',
'nc_068_custom_url_table',
]); ]);
} }
@ -244,6 +246,8 @@ export default class XcMigrationSourcev2 {
return nc_067_personal_view; return nc_067_personal_view;
case 'nc_068_user_delete': case 'nc_068_user_delete':
return nc_068_user_delete; return nc_068_user_delete;
case 'nc_068_custom_url_table':
return nc_068_custom_url_table;
} }
} }
} }

28
packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts

@ -0,0 +1,28 @@
import type { Knex } from 'knex';
import { MetaTable } from '~/utils/globals';
const up = async (knex: Knex) => {
await knex.schema.createTable(MetaTable.CUSTOM_URLS, (table) => {
table.string('id', 20);
table.string('fk_workspace_id', 20);
table.string('base_id', 20);
table.string('fk_model_id', 20);
table.string('view_id', 20);
table.string('original_path');
table.string('custom_path');
table.timestamps(true, true);
});
};
const down = async (knex: Knex) => {
await knex.schema.dropTable(MetaTable.CUSTOM_URLS);
};
export { up, down };

3
packages/nocodb/src/utils/globals.ts

@ -57,6 +57,7 @@ export enum MetaTable {
INTEGRATIONS_STORE = 'nc_integrations_store_v2', INTEGRATIONS_STORE = 'nc_integrations_store_v2',
FILE_REFERENCES = 'nc_file_references', FILE_REFERENCES = 'nc_file_references',
COL_BUTTON = 'nc_col_button_v2', COL_BUTTON = 'nc_col_button_v2',
CUSTOM_URLS = 'nc_custom_urls_v2',
} }
export enum MetaTableOldV2 { export enum MetaTableOldV2 {
@ -190,6 +191,7 @@ export enum CacheScope {
COL_BUTTON = 'colButton', COL_BUTTON = 'colButton',
CMD_PALETTE = 'cmdPalette', CMD_PALETTE = 'cmdPalette',
PRODUCT_FEED = 'productFeed', PRODUCT_FEED = 'productFeed',
CUSTOM_URLS = 'customUrls',
} }
export enum CacheGetType { export enum CacheGetType {
@ -235,6 +237,7 @@ export const RootScopeTables = {
MetaTable.FILE_REFERENCES, MetaTable.FILE_REFERENCES,
// Temporarily added need to be discussed within team // Temporarily added need to be discussed within team
MetaTable.AUDIT, MetaTable.AUDIT,
MetaTable.CUSTOM_URLS,
], ],
[RootScopes.BASE]: [MetaTable.PROJECT], [RootScopes.BASE]: [MetaTable.PROJECT],
// It's a special case and Workspace is equivalent to org in oss // It's a special case and Workspace is equivalent to org in oss

Loading…
Cancel
Save