From 8adf147fee1015a24b07c533e69560f225a8c489 Mon Sep 17 00:00:00 2001
From: Serhii Filonenko <91055067+serhii-filonenko@users.noreply.github.com>
Date: Fri, 6 Dec 2024 16:10:33 +0200
Subject: [PATCH] HCK-9036: remove mandatory quoting for default value (#43)
HCK-9036 [DB2] Unexpected quotation of table columns default
values
|
---
.../columnDefinition/getColumnDefault.js | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/forward_engineering/ddlProvider/ddlHelpers/columnDefinition/getColumnDefault.js b/forward_engineering/ddlProvider/ddlHelpers/columnDefinition/getColumnDefault.js
index d7bfd9c..0589127 100644
--- a/forward_engineering/ddlProvider/ddlHelpers/columnDefinition/getColumnDefault.js
+++ b/forward_engineering/ddlProvider/ddlHelpers/columnDefinition/getColumnDefault.js
@@ -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}
@@ -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 '';
};