Skip to content

Commit

Permalink
HCK-9036: remove mandatory quoting for default value
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii-filonenko committed Dec 6, 2024
1 parent 387c330 commit 583e146
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ const getIdentityOptions = ({ start, increment, minValue, maxValue, cycle }) =>
return [startWith, incrementBy, cycle, minimumValue, maximumValue].filter(Boolean).join(', ');
};

/**
* @param {{ defaultValue: DefaultValue, type: string }}
* @returns {DefaultValue}
*/
const wrapInQuotesDefaultValue = ({ defaultValue, type }) => {
const isStringDataType = STRING_DATA_TYPES.includes(toUpper(type));

return isStringDataType ? wrapInSingleQuotes({ name: defaultValue }) : defaultValue;
};

/**
* @param {{ default?: DefaultValue, identity?: object }}
* @returns {string}
Expand All @@ -59,9 +49,7 @@ const getColumnDefault = ({ default: defaultValue, identity, type }) => {
}

if (defaultValue || defaultValue === 0) {
const value = wrapInQuotesDefaultValue({ defaultValue, type });

return ` WITH DEFAULT ${value}`;
return ` WITH DEFAULT ${defaultValue}`;
}
return '';
};
Expand Down

0 comments on commit 583e146

Please sign in to comment.