Skip to content
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/ddlHelpers/indexHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ const getValue = value => {
};

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

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

const isUnique = index.unique && index.index_method === 'btree';
const name = wrapInQuotes(index.indxName);
const unique = isUnique ? ' UNIQUE' : '';
Expand Down
32 changes: 31 additions & 1 deletion properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,29 @@ 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 @@ -1024,6 +1046,10 @@ making sure that you maintain a proper JSON format.
"dependency": {
"key": "index_method",
"value": "btree"
},
"validation": {
"required": true,
"minLength": 1
}
},
{
Expand Down Expand Up @@ -1068,6 +1094,10 @@ making sure that you maintain a proper JSON format.
"value": "brin"
}
]
},
"validation": {
"required": true,
"minLength": 1
}
},
{
Expand Down