Skip to content

Commit

Permalink
HCK-9182 and HCK-9181 (#63)
Browse files Browse the repository at this point in the history
* HCK-9182: [MariaDB] Add 'ASC' index column sort strategy if user intentionally selected it to DDL tab

* HCK-9181: [MariaDB] Invalid 'KEY' index type is available for select in PP which breaks output DDL
  • Loading branch information
Nightlngale authored Jan 2, 2025
1 parent afe58c9 commit 05f1761
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 7 additions & 3 deletions forward_engineering/ddlProvider/ddlHelpers/keyHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ module.exports = (_, clean) => {
return 'ASC';
} else if (_.toLower(order) === 'desc') {
return 'DESC';
} else {
return '';
}

return '';
};

const mapKeyOrder = key => `\`${key.name}\`${key.type === 'DESC' ? ' DESC' : ''}`;
const mapKeyOrder = key => {
const order = getOrder(key.type);

return `\`${key.name}\`${order ? ` ${order}` : ''}`;
};

const hydrateUniqueOptions = (options, columnName, isActivated) =>
clean({
Expand Down
2 changes: 1 addition & 1 deletion properties_pane/entity_level/entityLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ making sure that you maintain a proper JSON format.
"propertyTooltip": "",
"propertyType": "select",
"defaultValue": "",
"options": ["", "KEY", "UNIQUE", "FULLTEXT", "SPATIAL"]
"options": ["", "UNIQUE", "FULLTEXT", "SPATIAL"]
},
{
"propertyName": "Category",
Expand Down
6 changes: 2 additions & 4 deletions reverse_engineering/helpers/mariadbHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,9 @@ const getIndexType = index => {
return 'SPATIAL';
} else if (Number(index['Non_unique']) === 0) {
return 'UNIQUE';
} else if (index['Index_type'] === 'KEY') {
return 'KEY';
} else {
return '';
}

return '';
};

const getIndexCategory = index => {
Expand Down

0 comments on commit 05f1761

Please sign in to comment.