Browse Source

refactor: update table drop migration (#8840)

Co-authored-by: Pranav C <pranavxc@gmail.com>
pull/8845/head
Raju Udava 2 weeks ago committed by GitHub
parent
commit
98bee4c748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 44
      packages/nocodb/src/meta/migrations/v1/nc_012_cloud_cleanup.ts

44
packages/nocodb/src/meta/migrations/v1/nc_012_cloud_cleanup.ts

@ -1,21 +1,31 @@
const up = async (knex) => { const up = async (knex) => {
await knex.schema.dropTable('nc_plugins'); const tablesToDrop = [
await knex.schema.dropTable('nc_disabled_models_for_role'); 'nc_plugins',
await knex.schema.dropTable('nc_shared_views'); 'nc_disabled_models_for_role',
await knex.schema.dropTable('nc_projects_users'); 'nc_shared_views',
await knex.schema.dropTable('nc_roles'); 'nc_projects_users',
await knex.schema.dropTable('nc_hooks'); 'nc_roles',
await knex.schema.dropTable('nc_cron'); 'nc_hooks',
await knex.schema.dropTable('nc_acl'); 'nc_cron',
await knex.schema.dropTable('nc_models'); 'nc_acl',
await knex.schema.dropTable('nc_relations'); 'nc_models',
await knex.schema.dropTable('nc_routes'); 'nc_relations',
await knex.schema.dropTable('nc_resolvers'); 'nc_routes',
await knex.schema.dropTable('nc_loaders'); 'nc_resolvers',
await knex.schema.dropTable('nc_rpc'); 'nc_loaders',
await knex.schema.dropTable('nc_audit'); 'nc_rpc',
await knex.schema.dropTable('nc_migrations'); 'nc_audit',
await knex.schema.dropTable('nc_projects'); 'nc_migrations',
'nc_projects',
];
// check if table exist and remove if exist
for (const table of tablesToDrop) {
const tableExist = await knex.schema.hasTable(table);
if (tableExist) {
await knex.schema.dropTable(table);
}
}
}; };
const down = async (_knex) => {}; const down = async (_knex) => {};

Loading…
Cancel
Save