diff --git a/forward_engineering/helpers/commentIfDeactivated.js b/forward_engineering/helpers/commentIfDeactivated.js index 152d1d1..4ef1e93 100644 --- a/forward_engineering/helpers/commentIfDeactivated.js +++ b/forward_engineering/helpers/commentIfDeactivated.js @@ -1,5 +1,5 @@ const BEFORE_DEACTIVATED_STATEMENT = '-- '; -const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)|(\n\/\*\n[\s\S]*?\n\s\*\/)$/gi; +const REG_FOR_MULTYLINE_COMMENT = /(\n\/\*\n[\s\S]*?\n\s\*\/\n)$|(\n\/\*\n[\s\S]*?\n\s\*\/)$/gi; const commentIfDeactivated = (statement, data, isPartOfLine) => { if (data?.hasOwnProperty('isActivated') && !data.isActivated) { diff --git a/forward_engineering/helpers/indexHelper.js b/forward_engineering/helpers/indexHelper.js index a84d629..382ad1e 100644 --- a/forward_engineering/helpers/indexHelper.js +++ b/forward_engineering/helpers/indexHelper.js @@ -223,7 +223,7 @@ module.exports = app => { const createTableIndex = (terminator, tableName, index, isParentActivated) => { if (index.type === 'spatial') { - return createSpatialIndex(terminator, tableName, index, isParentActivated); + return createSpatialIndex(terminator, tableName, index); } else if (index.type === 'fulltext') { return createFullTextIndex(terminator, tableName, index); } else { diff --git a/reverse_engineering/reverseEngineeringService/helpers/reorderTableRows.js b/reverse_engineering/reverseEngineeringService/helpers/reorderTableRows.js index 9ab697a..864a824 100644 --- a/reverse_engineering/reverseEngineeringService/helpers/reorderTableRows.js +++ b/reverse_engineering/reverseEngineeringService/helpers/reorderTableRows.js @@ -7,7 +7,7 @@ const reorderTableRows = (tableRows, isFieldOrderAlphabetic) => { return tableRows; } - const reorderedFieldNames = Object.keys(tableRows[0]).sort(); + const reorderedFieldNames = Object.keys(tableRows[0]).sort((a, b) => a?.localeCompare?.(b)); return tableRows.map(row => Object.values(row).reduce( (columns, columnValue, i) => ({ diff --git a/reverse_engineering/reverseEngineeringService/helpers/reverseTableColumn.js b/reverse_engineering/reverseEngineeringService/helpers/reverseTableColumn.js index ebdb662..89933c1 100644 --- a/reverse_engineering/reverseEngineeringService/helpers/reverseTableColumn.js +++ b/reverse_engineering/reverseEngineeringService/helpers/reverseTableColumn.js @@ -52,8 +52,8 @@ const handleDefault = (typeObject, value) => { const validValue = { numeric: Number(value.replace(/(^\(\()|(\)\)$)/g, '')), - char: value.replace(/(^\(\')|(\'\))$/g, ''), - xml: value.replace(/(^\(N\')|(\'\))$/g, ''), + char: value.replace(/(^\(')$|('\))$/g, ''), + xml: value.replace(/(^\(N')$|('\))$/g, ''), }[typeObject.type]; return { default: validValue !== undefined ? validValue : value };