|
|
@ -455,9 +455,21 @@ export class TablesService { |
|
|
|
|
|
|
|
|
|
|
|
const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); |
|
|
|
const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uniqueColumnNameCount = {}; |
|
|
|
|
|
|
|
|
|
|
|
for (const column of param.table.columns) { |
|
|
|
for (const column of param.table.columns) { |
|
|
|
if (!isVirtualCol(column)) { |
|
|
|
if (!isVirtualCol(column)) { |
|
|
|
column.column_name = sanitizeColumnName(column.column_name); |
|
|
|
column.column_name = sanitizeColumnName(column.column_name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (uniqueColumnNameCount[column.column_name]) { |
|
|
|
|
|
|
|
let suffix = 1; |
|
|
|
|
|
|
|
let targetColumnName = `${column.column_name}_${suffix++}`; |
|
|
|
|
|
|
|
while (uniqueColumnNameCount[targetColumnName]) { |
|
|
|
|
|
|
|
targetColumnName = `${column.column_name}_${suffix++}`; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
column.column_name = targetColumnName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
uniqueColumnNameCount[column.column_name] = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (column.column_name.length > mxColumnLength) { |
|
|
|
if (column.column_name.length > mxColumnLength) { |
|
|
|