Skip to content

Commit c9ccb91

Browse files
HCK-14265: fix empty key options (#71)
<!--do not remove this marker, its needed to replace info when ticket title is updated --> <!--jira-description-action-hidden-marker-start--> <table> <td> <a href="https://hackolade.atlassian.net/browse/HCK-14265" title="HCK-14265" target="_blank"><img alt="Sub-bug" src="https://hackolade.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" />HCK-14265</a> [DB2] Error appears when applying different generation options for UK and Not Null </td></table> <br /> <!--jira-description-action-hidden-marker-end--> ## Content You have no Jira task for this PR? Describe your changes here... ... ## Technical details You feel the need to provide technical explanations? You can do it here... ...
1 parent 07f5cac commit c9ccb91

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

forward_engineering/alterScript/alterScriptHelpers/entityHelpers/primaryKeyHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const extractOptionsForComparisonWithRegularPkOptions = (optionHolder = {}) => {
3232
};
3333

3434
const getCustomPropertiesOfRegularPkForComparisonWithRegularPkOptions = columnJsonSchema => {
35-
return extractOptionsForComparisonWithRegularPkOptions(columnJsonSchema.primaryKeyOptions);
35+
return extractOptionsForComparisonWithRegularPkOptions(columnJsonSchema.primaryKeyOptions || {});
3636
};
3737

3838
const getCustomPropertiesOfCompositePkForComparisonWithRegularPkOptions = compositePk => {
3939
const optionsForComparison = extractOptionsForComparisonWithRegularPkOptions(compositePk);
40-
return [optionsForComparison].filter(o => Object.values(o).some(Boolean));
40+
return optionsForComparison;
4141
};
4242

4343
const wasCompositePkChangedInTransitionFromCompositeToRegular = collection => {

forward_engineering/alterScript/alterScriptHelpers/entityHelpers/uniqueKeyHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const extractOptionsForComparisonWithRegularUniqueKeyOptions = optionHolder => {
3232
};
3333

3434
const getCustomPropertiesOfRegularUniqueKeyForComparisonWithRegularUniqueKeyOptions = columnJsonSchema => {
35-
return extractOptionsForComparisonWithRegularUniqueKeyOptions(columnJsonSchema.uniqueKeyOptions);
35+
return extractOptionsForComparisonWithRegularUniqueKeyOptions(columnJsonSchema.uniqueKeyOptions || {});
3636
};
3737

3838
const getCustomPropertiesOfCompositeUniqueKeyForComparisonWithRegularUniqueKeyOptions = compositeUniqueKey => {
3939
const optionsForComparison = extractOptionsForComparisonWithRegularUniqueKeyOptions(compositeUniqueKey);
40-
return [optionsForComparison].filter(o => Object.values(o).some(Boolean));
40+
return optionsForComparison;
4141
};
4242

4343
const wasCompositeUniqueKeyChangedInTransitionFromCompositeToRegular = collection => {

0 commit comments

Comments
 (0)