From af7b94a0238787950e81b97bf3ffe8d20f813a3d Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Sun, 15 Dec 2024 15:46:32 +0200 Subject: [PATCH] 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",