fix: indexes and foreign keys not cleared after deletion of related field, closes #182

This commit is contained in:
Fabio Di Stasio 2022-01-28 23:57:53 +01:00
parent 401cb49687
commit 9f033fb994
1 changed files with 8 additions and 0 deletions

View File

@ -616,6 +616,14 @@ export default {
},
removeField (uid) {
this.localFields = this.localFields.filter(field => field._antares_id !== uid);
this.localKeyUsage = this.localKeyUsage.filter(fk =>// Clear foreign keys
this.localFields.some(field => field.name === fk.field)
);
this.localIndexes = this.localIndexes.filter(index =>// Clear indexes
this.localFields.some(field =>
index.fields.includes(field.name)
)
);
},
addNewIndex (payload) {
this.localIndexes = [...this.localIndexes, {