fix: remove old way of adding way uuids

This commit is contained in:
Nybkox
2025-01-23 16:40:38 +01:00
parent 09fa3ce438
commit 50f9e025c4
4 changed files with 6 additions and 25 deletions

View File

@@ -313,19 +313,7 @@ export function extractChangeSetCondition(
table?: TableInfo,
dialect?: SqlDialect
): Condition {
function getShouldUseRawRightValue(columnName: string) {
if (!table || !dialect || !dialect.rawUuids) return false;
const column = table.columns.find(x => x.columnName == columnName);
if (!column) return false;
if (column.dataType !== 'uuid') return false;
return true;
}
function getColumnCondition(columnName: string): Condition {
const shouldUseRawRightValue = getShouldUseRawRightValue(columnName);
const dataType = table?.columns?.find(x => x.columnName == columnName)?.dataType;
const value = item.condition[columnName];
@@ -352,16 +340,11 @@ export function extractChangeSetCondition(
conditionType: 'binary',
operator: '=',
left: expr,
right: shouldUseRawRightValue
? {
exprType: 'raw',
sql: value,
}
: {
exprType: 'value',
dataType,
value,
},
right: {
exprType: 'value',
dataType,
value,
},
};
}
}

View File

@@ -17,7 +17,6 @@ export interface SqlDialect {
enableConstraintsPerTable?: boolean;
requireStandaloneSelectForScopeIdentity?: boolean;
allowMultipleValuesInsert?: boolean;
rawUuids?: boolean;
dropColumnDependencies?: string[];
changeColumnDependencies?: string[];

View File

@@ -160,7 +160,7 @@
const driver = findEngineDriver($connection, $extensions);
const script = driver.createSaveChangeSetScript($changeSetStore?.value, $dbinfo, () =>
changeSetToSql($changeSetStore?.value, $dbinfo)
changeSetToSql($changeSetStore?.value, $dbinfo, driver.dialect)
);
const deleteCascades = getDeleteCascades($changeSetStore?.value, $dbinfo);

View File

@@ -7,7 +7,6 @@ const _cloneDeepWith = require('lodash/cloneDeepWith');
const dialect = {
limitSelect: true,
rangeSelect: true,
rawUuids: true,
stringEscapeChar: "'",
fallbackDataType: 'varchar',
offsetNotSupported: true,