|
|
|
@ -32,6 +32,7 @@ import ncModelsOrderUpgrader from './jobs/ncModelsOrderUpgrader';
|
|
|
|
|
import ncParentModelTitleUpgrader from './jobs/ncParentModelTitleUpgrader'; |
|
|
|
|
import ncRemoveDuplicatedRelationRows from './jobs/ncRemoveDuplicatedRelationRows'; |
|
|
|
|
import xcMetaDiffSync from './handlers/xcMetaDiffSync'; |
|
|
|
|
import UITypes from '../../sqlUi/UITypes'; |
|
|
|
|
|
|
|
|
|
const log = debug('nc:api:base'); |
|
|
|
|
|
|
|
|
@ -755,11 +756,12 @@ export default abstract class BaseApiBuilder<T extends Noco>
|
|
|
|
|
const columns = |
|
|
|
|
changeObj.columns |
|
|
|
|
.filter(c => c.altered !== 4) |
|
|
|
|
.map(({ altered: _al, ...rest }) => ({ |
|
|
|
|
...rest, |
|
|
|
|
// find and overwrite column property from db
|
|
|
|
|
...(columnsFromDb?.find(c => c.cn === rest.cn) || {}) |
|
|
|
|
})) || (await this.getColumnList(tn)); |
|
|
|
|
.map(({ altered: _al, ...rest }) => |
|
|
|
|
this.mergeUiColAndDbColMetas( |
|
|
|
|
rest, |
|
|
|
|
columnsFromDb?.find(c => c.cn === rest.cn) |
|
|
|
|
) |
|
|
|
|
) || (await this.getColumnList(tn)); |
|
|
|
|
|
|
|
|
|
/* Get all relations */ |
|
|
|
|
const relations = await this.relationsSyncAndGet(); |
|
|
|
@ -1201,6 +1203,22 @@ export default abstract class BaseApiBuilder<T extends Noco>
|
|
|
|
|
await NcHelp.executeOperations(aclOper, this.connectionConfig.client); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected mergeUiColAndDbColMetas(uiCol, dbCol) { |
|
|
|
|
return { |
|
|
|
|
...(uiCol || {}), |
|
|
|
|
...(dbCol || {}), |
|
|
|
|
// persist x props for single/multi select
|
|
|
|
|
...(uiCol?.uidt === UITypes.SingleSelect || |
|
|
|
|
uiCol?.uidt === UITypes.MultiSelect |
|
|
|
|
? { |
|
|
|
|
dtx: uiCol.dtx, |
|
|
|
|
dtxp: uiCol.dtxp, |
|
|
|
|
dtxs: uiCol.dtxs |
|
|
|
|
} |
|
|
|
|
: {}) |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async onViewUpdate( |
|
|
|
|
viewName: string, |
|
|
|
|
beforeMetaUpdate?: (args: any) => Promise<void> |
|
|
|
|