Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions forward_engineering/ddlProvider/ddlHelpers/indexHelper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const _ = require('lodash');
const { escapeSingleQuote } = require('../../utils/general');
const { escapeSingleQuote, normalizeLineEndings } = require('../../utils/general');

module.exports = ({ prepareName, getNamePrefixedWithSchemaName }) => {
const getIndexType = indexType => {
Expand Down Expand Up @@ -51,9 +51,9 @@ module.exports = ({ prepareName, getNamePrefixedWithSchemaName }) => {
let options = `${loggingClause}${tableSpacePart}${indexCompression}`;

if (index_properties) {
options = ` ${index_properties}`;
options = ` ${normalizeLineEndings(index_properties)}`;
} else if (index_attributes) {
options = ` ${index_attributes}`;
options = ` ${normalizeLineEndings(index_attributes)}`;
}
const isKeysEmpty = _.isEmpty(indxKey) && _.isEmpty(column_expression);

Expand Down
3 changes: 3 additions & 0 deletions forward_engineering/utils/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ const isParentContainerActivated = collection => {

const getId = entity => entity.id || entity.role.id;

const normalizeLineEndings = str => str.replaceAll('\r\n', '\n');

module.exports = {
getDbName,
getBucketName,
Expand Down Expand Up @@ -265,4 +267,5 @@ module.exports = {
isObjectInDeltaModelActivated,
isParentContainerActivated,
getId,
normalizeLineEndings,
};