Browse Source

refactor: update table drop migration (#8840)

Co-authored-by: Pranav C <pranavxc@gmail.com>
pull/8845/head
Raju Udava 1 week 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) => {
await knex.schema.dropTable('nc_plugins');
await knex.schema.dropTable('nc_disabled_models_for_role');
await knex.schema.dropTable('nc_shared_views');
await knex.schema.dropTable('nc_projects_users');
await knex.schema.dropTable('nc_roles');
await knex.schema.dropTable('nc_hooks');
await knex.schema.dropTable('nc_cron');
await knex.schema.dropTable('nc_acl');
await knex.schema.dropTable('nc_models');
await knex.schema.dropTable('nc_relations');
await knex.schema.dropTable('nc_routes');
await knex.schema.dropTable('nc_resolvers');
await knex.schema.dropTable('nc_loaders');
await knex.schema.dropTable('nc_rpc');
await knex.schema.dropTable('nc_audit');
await knex.schema.dropTable('nc_migrations');
await knex.schema.dropTable('nc_projects');
const tablesToDrop = [
'nc_plugins',
'nc_disabled_models_for_role',
'nc_shared_views',
'nc_projects_users',
'nc_roles',
'nc_hooks',
'nc_cron',
'nc_acl',
'nc_models',
'nc_relations',
'nc_routes',
'nc_resolvers',
'nc_loaders',
'nc_rpc',
'nc_audit',
'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) => {};

Loading…
Cancel
Save