From 85ab392d1540b99775de379906e1af9baa359c91 Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Thu, 12 Dec 2024 15:04:17 +0200 Subject: [PATCH 1/3] HCK-9128: Handle indexes without name --- forward_engineering/ddlProvider/ddlProvider.js | 5 +++++ properties_pane/entity_level/entityLevelConfig.json | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 1820157..fade1e0 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -385,6 +385,11 @@ module.exports = (baseProvider, options, app) => { createIndex(tableName, index) { const indexName = getIndexName({ index }); + + if (!indexName.trim()) { + return ''; + } + const indexType = getIndexType({ index }); const indexOptions = getIndexOptions({ index }); const indexTableName = getNamePrefixedWithSchemaName({ name: tableName, schemaName: index.schemaName }); diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 6b57f93..4bb8068 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -401,7 +401,10 @@ making sure that you maintain a proper JSON format. "propertyName": "Name", "propertyKeyword": "indxName", "propertyTooltip": "", - "propertyType": "text" + "propertyType": "text", + "validation": { + "required": true + } }, { "propertyName": "Activated", From 6dbbf038a04d369bdd0ed43313e1d87638dd6b1e Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Fri, 13 Dec 2024 21:00:50 +0200 Subject: [PATCH 2/3] HCK-9128: Handle indexes without indxKey --- forward_engineering/ddlProvider/ddlProvider.js | 2 +- properties_pane/entity_level/entityLevelConfig.json | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index fade1e0..6124ef8 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -386,7 +386,7 @@ module.exports = (baseProvider, options, app) => { createIndex(tableName, index) { const indexName = getIndexName({ index }); - if (!indexName.trim()) { + if (!indexName.trim() || !index.indxKey.length) { return ''; } diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index 4bb8068..d32098f 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -424,7 +424,11 @@ making sure that you maintain a proper JSON format. "propertyKeyword": "indxKey", "propertyType": "fieldList", "template": "orderedList", - "attributeList": ["asc", "desc", "random"] + "attributeList": ["asc", "desc", "random"], + "validation": { + "minLength": 1, + "required": true + } }, { "propertyName": "Include keys", From 838ca188f4197e48b0457055b74560e0d7d22b7f Mon Sep 17 00:00:00 2001 From: yevhenii-moroziuk Date: Mon, 16 Dec 2024 17:18:16 +0200 Subject: [PATCH 3/3] HCK-9128: Fix the logic --- forward_engineering/ddlProvider/ddlProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 6124ef8..2903eb0 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -386,7 +386,7 @@ module.exports = (baseProvider, options, app) => { createIndex(tableName, index) { const indexName = getIndexName({ index }); - if (!indexName.trim() || !index.indxKey.length) { + if (!index.indxName || !index.indxKey.length) { return ''; }