Browse Source

test: clear hooks during project reset

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5937/head
Raju Udava 2 years ago
parent
commit
764cd102aa
  1. 6
      packages/nocodb/src/models/Model.ts

6
packages/nocodb/src/models/Model.ts

@ -14,6 +14,7 @@ import {
import { NcError } from '../helpers/catchError';
import { sanitize } from '../helpers/sqlSanitize';
import { extractProps } from '../helpers/extractProps';
import Hook from './Hook';
import Audit from './Audit';
import View from './View';
import Column from './Column';
@ -376,6 +377,11 @@ export default class Model implements TableType {
await view.delete(ncMeta);
}
// delete associated hooks
for (const hook of await Hook.list({ fk_model_id: this.id }, ncMeta)) {
await Hook.delete(hook.id, ncMeta);
}
for (const col of await this.getColumns(ncMeta)) {
let colOptionTableName = null;
let cacheScopeName = null;

Loading…
Cancel
Save