Browse Source

feat(nocodb): add custom url table

Ramesh Mane 4 days ago
parent
commit
58963d0013
  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_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_custom_url_table from '~/meta/migrations/v2/nc_068_custom_url_table';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -121,6 +122,7 @@ export default class XcMigrationSourcev2 {
'nc_066_ai_button',
'nc_067_personal_view',
'nc_068_user_delete',
'nc_068_custom_url_table',
]);
}
@ -244,6 +246,8 @@ export default class XcMigrationSourcev2 {
return nc_067_personal_view;
case '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',
FILE_REFERENCES = 'nc_file_references',
COL_BUTTON = 'nc_col_button_v2',
CUSTOM_URLS = 'nc_custom_urls_v2',
}
export enum MetaTableOldV2 {
@ -190,6 +191,7 @@ export enum CacheScope {
COL_BUTTON = 'colButton',
CMD_PALETTE = 'cmdPalette',
PRODUCT_FEED = 'productFeed',
CUSTOM_URLS = 'customUrls',
}
export enum CacheGetType {
@ -235,6 +237,7 @@ export const RootScopeTables = {
MetaTable.FILE_REFERENCES,
// Temporarily added need to be discussed within team
MetaTable.AUDIT,
MetaTable.CUSTOM_URLS,
],
[RootScopes.BASE]: [MetaTable.PROJECT],
// It's a special case and Workspace is equivalent to org in oss

Loading…
Cancel
Save