diff --git a/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts b/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts index e4a0cb72d0..d37f1c9f28 100644 --- a/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts @@ -55,7 +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'; +import * as nc_068_custom_url from '~/meta/migrations/v2/nc_068_custom_url'; // Create a custom migration source class export default class XcMigrationSourcev2 { @@ -122,7 +122,7 @@ export default class XcMigrationSourcev2 { 'nc_066_ai_button', 'nc_067_personal_view', 'nc_068_user_delete', - 'nc_068_custom_url_table', + 'nc_068_custom_url', ]); } @@ -246,8 +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; + case 'nc_068_custom_url': + return nc_068_custom_url; } } } diff --git a/packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts b/packages/nocodb/src/meta/migrations/v2/nc_068_custom_url.ts similarity index 56% rename from packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts rename to packages/nocodb/src/meta/migrations/v2/nc_068_custom_url.ts index 666382e4ff..1e03520f01 100644 --- a/packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts +++ b/packages/nocodb/src/meta/migrations/v2/nc_068_custom_url.ts @@ -19,10 +19,26 @@ const up = async (knex: Knex) => { table.timestamps(true, true); }); + + await knex.schema.alterTable(MetaTable.PROJECT, (table) => { + table.string('fk_custom_url_id', 20).index(); + }); + + await knex.schema.alterTable(MetaTable.VIEWS, (table) => { + table.string('fk_custom_url_id', 20).index(); + }); }; const down = async (knex: Knex) => { await knex.schema.dropTable(MetaTable.CUSTOM_URLS); + + await knex.schema.alterTable(MetaTable.PROJECT, (table) => { + table.dropColumn('fk_custom_url_id'); + }); + + await knex.schema.alterTable(MetaTable.VIEWS, (table) => { + table.dropColumn('fk_custom_url_id'); + }); }; export { up, down };