mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 18:03:58 +00:00
fix: remove old way of adding way uuids
This commit is contained in:
@@ -313,19 +313,7 @@ export function extractChangeSetCondition(
|
|||||||
table?: TableInfo,
|
table?: TableInfo,
|
||||||
dialect?: SqlDialect
|
dialect?: SqlDialect
|
||||||
): Condition {
|
): 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 {
|
function getColumnCondition(columnName: string): Condition {
|
||||||
const shouldUseRawRightValue = getShouldUseRawRightValue(columnName);
|
|
||||||
const dataType = table?.columns?.find(x => x.columnName == columnName)?.dataType;
|
const dataType = table?.columns?.find(x => x.columnName == columnName)?.dataType;
|
||||||
|
|
||||||
const value = item.condition[columnName];
|
const value = item.condition[columnName];
|
||||||
@@ -352,16 +340,11 @@ export function extractChangeSetCondition(
|
|||||||
conditionType: 'binary',
|
conditionType: 'binary',
|
||||||
operator: '=',
|
operator: '=',
|
||||||
left: expr,
|
left: expr,
|
||||||
right: shouldUseRawRightValue
|
right: {
|
||||||
? {
|
exprType: 'value',
|
||||||
exprType: 'raw',
|
dataType,
|
||||||
sql: value,
|
value,
|
||||||
}
|
},
|
||||||
: {
|
|
||||||
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;
|
enableConstraintsPerTable?: boolean;
|
||||||
requireStandaloneSelectForScopeIdentity?: boolean;
|
requireStandaloneSelectForScopeIdentity?: boolean;
|
||||||
allowMultipleValuesInsert?: boolean;
|
allowMultipleValuesInsert?: boolean;
|
||||||
rawUuids?: boolean;
|
|
||||||
|
|
||||||
dropColumnDependencies?: string[];
|
dropColumnDependencies?: string[];
|
||||||
changeColumnDependencies?: string[];
|
changeColumnDependencies?: string[];
|
||||||
|
|||||||
@@ -160,7 +160,7 @@
|
|||||||
const driver = findEngineDriver($connection, $extensions);
|
const driver = findEngineDriver($connection, $extensions);
|
||||||
|
|
||||||
const script = driver.createSaveChangeSetScript($changeSetStore?.value, $dbinfo, () =>
|
const script = driver.createSaveChangeSetScript($changeSetStore?.value, $dbinfo, () =>
|
||||||
changeSetToSql($changeSetStore?.value, $dbinfo)
|
changeSetToSql($changeSetStore?.value, $dbinfo, driver.dialect)
|
||||||
);
|
);
|
||||||
|
|
||||||
const deleteCascades = getDeleteCascades($changeSetStore?.value, $dbinfo);
|
const deleteCascades = getDeleteCascades($changeSetStore?.value, $dbinfo);
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ const _cloneDeepWith = require('lodash/cloneDeepWith');
|
|||||||
const dialect = {
|
const dialect = {
|
||||||
limitSelect: true,
|
limitSelect: true,
|
||||||
rangeSelect: true,
|
rangeSelect: true,
|
||||||
rawUuids: true,
|
|
||||||
stringEscapeChar: "'",
|
stringEscapeChar: "'",
|
||||||
fallbackDataType: 'varchar',
|
fallbackDataType: 'varchar',
|
||||||
offsetNotSupported: true,
|
offsetNotSupported: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user