Fix overriding viewv2 schemas

This commit is contained in:
Adria Navarro 2023-08-09 12:53:08 +03:00
parent 4db33b9d75
commit dcf26dd0cb
1 changed files with 7 additions and 1 deletions

View File

@ -97,7 +97,13 @@ export async function save(ctx: any) {
// update schema of non-statistics views when new columns are added
for (let view in tableToSave.views) {
const tableView = tableToSave.views[view]
if (!tableView || sdk.views.isV2(tableView)) continue
if (!tableView) continue
if (sdk.views.isV2(tableView)) {
// We don't want to modify views from the tables controller
tableToSave.views[view] = oldTable!.views![view]
continue
}
if (
(tableView.schema as ViewStatisticsSchema).group ||