|
|
|
@ -823,84 +823,33 @@ export default class Column<T = any> implements ColumnType {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Grid View Columns
|
|
|
|
|
const gridViewColumns = await ncMeta.metaList2( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
// Delete from all view columns
|
|
|
|
|
const viewColumnTables = [ |
|
|
|
|
MetaTable.GRID_VIEW_COLUMNS, |
|
|
|
|
{ |
|
|
|
|
condition: { fk_column_id: id }, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
await ncMeta.metaDelete(null, null, MetaTable.GRID_VIEW_COLUMNS, { |
|
|
|
|
fk_column_id: id, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (const gridViewColumn of gridViewColumns) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|
`${CacheScope.GRID_VIEW_COLUMN}:${gridViewColumn.id}`, |
|
|
|
|
CacheDelDirection.CHILD_TO_PARENT, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Form View Columns
|
|
|
|
|
const formViewColumns = await ncMeta.metaList2( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
MetaTable.FORM_VIEW_COLUMNS, |
|
|
|
|
{ |
|
|
|
|
condition: { fk_column_id: id }, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
await ncMeta.metaDelete(null, null, MetaTable.FORM_VIEW_COLUMNS, { |
|
|
|
|
fk_column_id: id, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (const formViewColumn of formViewColumns) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|
`${CacheScope.FORM_VIEW_COLUMN}:${formViewColumn.id}`, |
|
|
|
|
CacheDelDirection.CHILD_TO_PARENT, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Kanban View Columns
|
|
|
|
|
const kanbanViewColumns = await ncMeta.metaList2( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
MetaTable.KANBAN_VIEW_COLUMNS, |
|
|
|
|
{ |
|
|
|
|
condition: { fk_column_id: id }, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
await ncMeta.metaDelete(null, null, MetaTable.KANBAN_VIEW_COLUMNS, { |
|
|
|
|
fk_column_id: id, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (const kanbanViewColumn of kanbanViewColumns) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|
`${CacheScope.KANBAN_VIEW_COLUMN}:${kanbanViewColumn.id}`, |
|
|
|
|
CacheDelDirection.CHILD_TO_PARENT, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Gallery View Column
|
|
|
|
|
const galleryViewColumns = await ncMeta.metaList2( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
MetaTable.GALLERY_VIEW_COLUMNS, |
|
|
|
|
{ |
|
|
|
|
]; |
|
|
|
|
const viewColumnCacheScope = [ |
|
|
|
|
CacheScope.GRID_VIEW_COLUMN, |
|
|
|
|
CacheScope.FORM_VIEW_COLUMN, |
|
|
|
|
CacheScope.KANBAN_VIEW_COLUMN, |
|
|
|
|
CacheScope.GALLERY_VIEW_COLUMN, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
for (let i; i < viewColumnTables.length; i++) { |
|
|
|
|
const table = viewColumnTables[i]; |
|
|
|
|
const cacheScope = viewColumnCacheScope[i]; |
|
|
|
|
const viewColumns = await ncMeta.metaList2(null, null, table, { |
|
|
|
|
condition: { fk_column_id: id }, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
await ncMeta.metaDelete(null, null, MetaTable.GALLERY_VIEW_COLUMNS, { |
|
|
|
|
fk_column_id: id, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
for (const galleryViewColumn of galleryViewColumns) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|
`${CacheScope.GALLERY_VIEW_COLUMN}:${galleryViewColumn.id}`, |
|
|
|
|
CacheDelDirection.CHILD_TO_PARENT, |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
await ncMeta.metaDelete(null, null, table, { fk_column_id: id }); |
|
|
|
|
for (const viewColumn of viewColumns) { |
|
|
|
|
await NocoCache.deepDel( |
|
|
|
|
`${cacheScope}:${viewColumn.id}`, |
|
|
|
|
CacheDelDirection.CHILD_TO_PARENT, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Get LTAR columns in which current column is referenced as foreign key
|
|
|
|
|