From 67059f1e5c94df48227c020589a2ffe7cf96a781 Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Fri, 13 Dec 2024 21:15:52 +0200 Subject: [PATCH 1/3] HCK-9128: Handle indexes without indxKey --- .../ddlProvider/ddlProvider.js | 4 ++++ .../entity_level/entityLevelConfig.json | 20 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index c43415e..3f88a4d 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -277,6 +277,10 @@ module.exports = (baseProvider, options, app) => { }, createIndex(tableName, index, dbData, isParentActivated = true) { + if (!index.columns.length) { + return ''; + } + const name = wrapInQuotes(index.indxName); const unique = index.unique && index.index_method === 'btree' ? ' UNIQUE' : ''; const concurrently = index.concurrently ? ' CONCURRENTLY' : ''; diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 01ddaf9..5860119 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -2,9 +2,9 @@ * Copyright © 2016-2020 by IntegrIT S.A. dba Hackolade. All rights reserved. * * The copyright to the computer software herein is the property of IntegrIT S.A. -* The software may be used and/or copied only with the written permission of -* IntegrIT S.A. or in accordance with the terms and conditions stipulated in -* the agreement/contract under which the software has been supplied. +* The software may be used and/or copied only with the written permission of +* IntegrIT S.A. or in accordance with the terms and conditions stipulated in +* the agreement/contract under which the software has been supplied. In order to define custom properties for any object's properties pane, you may copy/paste from the following, making sure that you maintain a proper JSON format. @@ -70,8 +70,8 @@ making sure that you maintain a proper JSON format. ] }, // “groupInput” can have the following states - 0 items, 1 item, and many items. -// “blockInput” has only 2 states - 0 items or 1 item. -// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing +// “blockInput” has only 2 states - 0 items or 1 item. +// This gives us an easy way to represent it as an object and not as an array internally which is beneficial for processing // and forward-engineering in particular. { "propertyName": "Block", @@ -99,7 +99,7 @@ making sure that you maintain a proper JSON format. "propertyKeyword": "keyList", "propertyType": "fieldList", "template": "orderedList" - }, + }, { "propertyName": "List with attribute", "propertyKeyword": "keyListOrder", @@ -886,6 +886,10 @@ making sure that you maintain a proper JSON format. "key": "index_method", "value": "btree" } + }, + "validation": { + "required": true, + "minLength": 1 } }, { @@ -919,6 +923,10 @@ making sure that you maintain a proper JSON format. "dependency": { "key": "index_method", "value": "btree" + }, + "validation": { + "required": true, + "minLength": 1 } }, { From af7b94a0238787950e81b97bf3ffe8d20f813a3d Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Sun, 15 Dec 2024 15:46:32 +0200 Subject: [PATCH 2/3] HCK-9128: Handle indexes without indxKey --- .../ddlProvider/ddlProvider.js | 4 +++- .../entity_level/entityLevelConfig.json | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 3f88a4d..49ae382 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -277,7 +277,9 @@ module.exports = (baseProvider, options, app) => { }, createIndex(tableName, index, dbData, isParentActivated = true) { - if (!index.columns.length) { + const isNameEmpty = !index.indxName && index.ifNotExist; + + if (!index.columns.length || isNameEmpty) { return ''; } diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 5860119..c9ccc8d 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -808,7 +808,24 @@ making sure that you maintain a proper JSON format. "propertyName": "Name", "propertyKeyword": "indxName", "propertyTooltip": "Optional, if not specified an automatic name will be assigned. Index name are needed to drop indexes and appear in error messages when a constraint is violated.", - "propertyType": "text" + "propertyType": "text", + "dependency": { + "key": "ifNotExist", + "value": false + } + }, + { + "propertyName": "Name", + "propertyKeyword": "indxName", + "propertyTooltip": "", + "propertyType": "text", + "validation": { + "required": true + }, + "dependency": { + "key": "ifNotExist", + "value": true + } }, { "propertyName": "Activated", From a24c453d25b08d0a52e0b2da040a8fd819530aea Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Mon, 16 Dec 2024 12:27:17 +0200 Subject: [PATCH 3/3] HCK-9128: fix config --- properties_pane/entity_level/entityLevelConfig.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index c9ccc8d..709b43e 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -810,8 +810,11 @@ making sure that you maintain a proper JSON format. "propertyTooltip": "Optional, if not specified an automatic name will be assigned. Index name are needed to drop indexes and appear in error messages when a constraint is violated.", "propertyType": "text", "dependency": { - "key": "ifNotExist", - "value": false + "type": "not", + "values": { + "key": "ifNotExist", + "value": true + } } }, {