Skip to content

Commit

Permalink
HCK-9128: Handle indexes without name in Db2 (#44)
Browse files Browse the repository at this point in the history
<!--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-9128"
title="HCK-9128" target="_blank"><img alt="Sub-task"
src="https://hackolade.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium"
/>HCK-9128</a> Handle indexes without name in all SQL-like targets,
depending whether name is mandatory or not
  </td></table>
  <br />
 

<!--jira-description-action-hidden-marker-end-->
## Content

Updated validation of required fields in "Create Index" script
- index name is required
- columns are required
  • Loading branch information
Nightlngale authored Dec 16, 2024
1 parent 0e821c4 commit 4f1f75a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions forward_engineering/ddlProvider/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ module.exports = (baseProvider, options, app) => {

createIndex(tableName, index) {
const indexName = getIndexName({ index });

if (!index.indxName || !index.indxKey.length) {
return '';
}

const indexType = getIndexType({ index });
const indexOptions = getIndexOptions({ index });
const indexTableName = getNamePrefixedWithSchemaName({ name: tableName, schemaName: index.schemaName });
Expand Down
11 changes: 9 additions & 2 deletions properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -421,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",
Expand Down

0 comments on commit 4f1f75a

Please sign in to comment.