mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 15:36:28 +00:00
fix: remove old way of adding way uuids
This commit is contained in:
@@ -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,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
1
packages/types/dialect.d.ts
vendored
1
packages/types/dialect.d.ts
vendored
@@ -17,7 +17,6 @@ export interface SqlDialect {
|
||||
enableConstraintsPerTable?: boolean;
|
||||
requireStandaloneSelectForScopeIdentity?: boolean;
|
||||
allowMultipleValuesInsert?: boolean;
|
||||
rawUuids?: boolean;
|
||||
|
||||
dropColumnDependencies?: string[];
|
||||
changeColumnDependencies?: string[];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -7,7 +7,6 @@ const _cloneDeepWith = require('lodash/cloneDeepWith');
|
||||
const dialect = {
|
||||
limitSelect: true,
|
||||
rangeSelect: true,
|
||||
rawUuids: true,
|
||||
stringEscapeChar: "'",
|
||||
fallbackDataType: 'varchar',
|
||||
offsetNotSupported: true,
|
||||
|
||||
Reference in New Issue
Block a user