|
|
@ -726,6 +726,9 @@ export default abstract class BaseApiBuilder<T extends Noco> |
|
|
|
this.baseLog(`onTableUpdate : Getting old model meta for '%s'`, tn); |
|
|
|
this.baseLog(`onTableUpdate : Getting old model meta for '%s'`, tn); |
|
|
|
XcCache.del([this.projectId, this.dbAlias, 'table', tn].join('::')); |
|
|
|
XcCache.del([this.projectId, this.dbAlias, 'table', tn].join('::')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get columns list from db
|
|
|
|
|
|
|
|
const columnsFromDb = await this.getColumnList(tn); |
|
|
|
|
|
|
|
|
|
|
|
const relationTableMetas: Set<any> = new Set(); |
|
|
|
const relationTableMetas: Set<any> = new Set(); |
|
|
|
|
|
|
|
|
|
|
|
const oldModelRow = await this.xcMeta.metaGet( |
|
|
|
const oldModelRow = await this.xcMeta.metaGet( |
|
|
@ -752,8 +755,11 @@ export default abstract class BaseApiBuilder<T extends Noco> |
|
|
|
const columns = |
|
|
|
const columns = |
|
|
|
changeObj.columns |
|
|
|
changeObj.columns |
|
|
|
.filter(c => c.altered !== 4) |
|
|
|
.filter(c => c.altered !== 4) |
|
|
|
.map(({ altered: _al, ...rest }) => rest) || |
|
|
|
.map(({ altered: _al, ...rest }) => ({ |
|
|
|
(await this.getColumnList(tn)); |
|
|
|
...rest, |
|
|
|
|
|
|
|
// find and overwrite column property from db
|
|
|
|
|
|
|
|
...(columnsFromDb?.find(c => c.cn === rest.cn) || {}) |
|
|
|
|
|
|
|
})) || (await this.getColumnList(tn)); |
|
|
|
|
|
|
|
|
|
|
|
/* Get all relations */ |
|
|
|
/* Get all relations */ |
|
|
|
const relations = await this.relationsSyncAndGet(); |
|
|
|
const relations = await this.relationsSyncAndGet(); |
|
|
|