Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCK-9128: Handle indexes without name in YugabyteDB-YSQL #54

Merged
merged 3 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions forward_engineering/ddlProvider/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ module.exports = (baseProvider, options, app) => {
},

createIndex(tableName, index, dbData, isParentActivated = true) {
const isNameEmpty = !index.indxName && index.ifNotExist;

if (!index.columns.length || isNameEmpty) {
return '';
}

const name = wrapInQuotes(index.indxName);
const unique = index.unique && index.index_method === 'btree' ? ' UNIQUE' : '';
const concurrently = index.concurrently ? ' CONCURRENTLY' : '';
Expand Down
42 changes: 35 additions & 7 deletions properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -808,7 +808,27 @@ 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": {
"type": "not",
"values": {
"key": "ifNotExist",
"value": true
}
}
},
{
"propertyName": "Name",
"propertyKeyword": "indxName",
"propertyTooltip": "",
"propertyType": "text",
"validation": {
"required": true
},
"dependency": {
"key": "ifNotExist",
"value": true
}
},
{
"propertyName": "Activated",
Expand Down Expand Up @@ -886,6 +906,10 @@ making sure that you maintain a proper JSON format.
"key": "index_method",
"value": "btree"
}
},
"validation": {
"required": true,
"minLength": 1
}
},
{
Expand Down Expand Up @@ -919,6 +943,10 @@ making sure that you maintain a proper JSON format.
"dependency": {
"key": "index_method",
"value": "btree"
},
"validation": {
"required": true,
"minLength": 1
}
},
{
Expand Down