From 5564285ec77c07d0a063eb62e25d6fe1c6e1872c Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Tue, 10 Feb 2026 16:28:46 +0200 Subject: [PATCH 1/2] HCK-14758: Fix settings of clusteringKey --- .../alterScript/alterScriptHelpers/common.js | 36 ++++++++----------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/forward_engineering/alterScript/alterScriptHelpers/common.js b/forward_engineering/alterScript/alterScriptHelpers/common.js index 10d053c..a9934d9 100644 --- a/forward_engineering/alterScript/alterScriptHelpers/common.js +++ b/forward_engineering/alterScript/alterScriptHelpers/common.js @@ -1,34 +1,28 @@ +const { isEqual } = require('lodash'); const { escapeQuotes, getTimestamp, getName } = require('../../helpers/utils'); -const _ = require('lodash'); const getCompMod = containerData => containerData.role?.compMod ?? {}; -const checkCompModEqual = ({ new: newItem, old: oldItem } = {}) => _.isEqual(newItem, oldItem); +const checkCompModEqual = ({ new: newItem, old: oldItem } = {}) => isEqual(newItem, oldItem); const setEntityKeys = ({ idToNameHashTable, idToActivatedHashTable, entity }) => { + const setKeyArray = obj => + Array.isArray(obj) + ? obj.map(item => ({ + ...item, + name: idToNameHashTable[item.keyId], + isActivated: idToActivatedHashTable[item.keyId], + })) + : []; + return { ...entity, - clusteringKey: - entity.clusteringKey?.map(key => ({ - ...key, - name: idToNameHashTable[key.keyId], - isActivated: idToActivatedHashTable[key.keyId], - })) || [], - timeUnitpartitionKey: - entity.timeUnitpartitionKey?.map(key => ({ - ...key, - name: idToNameHashTable[key.keyId], - isActivated: idToActivatedHashTable[key.keyId], - })) || [], + clusteringKey: setKeyArray(entity.clusteringKey), + timeUnitpartitionKey: setKeyArray(entity.timeUnitpartitionKey), rangeOptions: [ { ...(entity.rangeOptions ?? {}), - rangePartitionKey: - entity.rangeOptions?.rangePartitionKey?.map(key => ({ - ...key, - name: idToNameHashTable[key.keyId], - isActivated: idToActivatedHashTable[key.keyId], - })) || [], + rangePartitionKey: setKeyArray(entity.rangeOptions?.rangePartitionKey), }, ], }; @@ -42,7 +36,7 @@ const getModifyOptions = ({ jsonSchema, app, options }) => { Object.entries(options).forEach(([customOptionName, columnOptionName]) => { const { new: newOptionValue, old: oldOptionValue } = jsonSchema.role.compMod[customOptionName] || {}; - if (!_.isEqual(newOptionValue, oldOptionValue)) { + if (!isEqual(newOptionValue, oldOptionValue)) { switch (customOptionName) { case 'businessName': { const name = getName(jsonSchema.role); From 0c2e473d40317947c60b7701a41b127cc316465b Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Tue, 10 Feb 2026 17:19:04 +0200 Subject: [PATCH 2/2] HCK-14759: Fix --- forward_engineering/alterScript/alterScriptHelpers/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forward_engineering/alterScript/alterScriptHelpers/common.js b/forward_engineering/alterScript/alterScriptHelpers/common.js index a9934d9..56dfb9f 100644 --- a/forward_engineering/alterScript/alterScriptHelpers/common.js +++ b/forward_engineering/alterScript/alterScriptHelpers/common.js @@ -34,7 +34,7 @@ const getModifyOptions = ({ jsonSchema, app, options }) => { const optionsToUpdate = []; Object.entries(options).forEach(([customOptionName, columnOptionName]) => { - const { new: newOptionValue, old: oldOptionValue } = jsonSchema.role.compMod[customOptionName] || {}; + const { new: newOptionValue, old: oldOptionValue } = jsonSchema.compMod[customOptionName] || {}; if (!isEqual(newOptionValue, oldOptionValue)) { switch (customOptionName) {