Browse Source

fix(nocodb): add fk_custom_url_id in base and view table

Ramesh Mane 1 week ago
parent
commit
d1ef68e166
  1. 8
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  2. 16
      packages/nocodb/src/meta/migrations/v2/nc_068_custom_url.ts

8
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;
}
}
}

16
packages/nocodb/src/meta/migrations/v2/nc_068_custom_url_table.ts → 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 };
Loading…
Cancel
Save