Skip to content

Commit 74bbae2

Browse files
authored
HCK-12336: remove redundant ASC keyword (#114)
1 parent 5bb92f8 commit 74bbae2

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

forward_engineering/helpers/constraintsHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = app => {
99

1010
const createKeyConstraint = (templates, terminator, isParentActivated) => keyData => {
1111
const partition = keyData.partition ? ` ON [${keyData.partition}]` : '';
12-
const columnMapToString = ({ name, order }) => `[${name}] ${order}`.trim();
12+
const columnMapToString = ({ name }) => `[${name}]`.trim();
1313

1414
const isAllColumnsDeactivated = checkAllKeysDeactivated(keyData.columns);
1515

forward_engineering/helpers/keyHelper.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,13 @@ module.exports = app => {
6565
}
6666
};
6767

68-
const getOrder = order => {
69-
if (_.toLower(order) === 'asc') {
70-
return 'ASC';
71-
} else if (_.toLower(order) === 'desc') {
72-
return 'DESC';
73-
} else {
74-
return '';
75-
}
76-
};
77-
7868
const hydrateUniqueOptions = (options, columnName, isActivated) =>
7969
clean({
8070
keyType: 'UNIQUE',
8171
name: options['constraintName'],
8272
columns: [
8373
{
8474
name: columnName,
85-
order: getOrder(options['order']),
8675
isActivated: isActivated,
8776
},
8877
],
@@ -108,7 +97,6 @@ module.exports = app => {
10897
columns: [
10998
{
11099
name: columnName,
111-
order: getOrder(options['order']),
112100
isActivated: isActivated,
113101
},
114102
],
@@ -143,7 +131,6 @@ module.exports = app => {
143131
return keys.map(key => {
144132
return {
145133
name: findName(key.keyId, jsonSchema.properties),
146-
order: key.type === 'descending' ? 'DESC' : 'ASC',
147134
isActivated: checkIfActivated(key.keyId, jsonSchema.properties),
148135
};
149136
});

reverse_engineering/reverseEngineeringService/helpers/defineFieldsCompositeKeyConstraints.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const PRIMARY_KEY = 'PRIMARY KEY';
77
const reverseCompositeKeys = keyConstraintsInfo => {
88
const keyCompositionStatuses = getKeyConstraintsCompositionStatuses(keyConstraintsInfo);
99
return keyConstraintsInfo.reduce((reversedKeys, keyConstraintInfo) => {
10-
const { columnName, constraintName, constraintType, isDescending } = keyConstraintInfo;
10+
const { columnName, constraintName, constraintType } = keyConstraintInfo;
1111
const compositionStatus = keyCompositionStatuses[constraintName];
1212
const existingReversedKey = reversedKeys[constraintName];
1313
const keyType = constraintType === PRIMARY_KEY ? 'compositePrimaryKey' : 'compositeUniqueKey';
@@ -24,7 +24,6 @@ const reverseCompositeKeys = keyConstraintsInfo => {
2424
[keyType]: [
2525
{
2626
name: columnName,
27-
type: isDescending ? 'descending' : 'ascending',
2827
},
2928
],
3029
},
@@ -44,7 +43,6 @@ const reverseCompositeKeys = keyConstraintsInfo => {
4443
...existingReversedKey[keyType],
4544
{
4645
name: columnName,
47-
type: isDescending ? 'descending' : 'ascending',
4846
},
4947
],
5048
},

0 commit comments

Comments
 (0)