mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 14:33:59 +00:00
#1111 mssql - handle timestamp and computed columns in clonerows
This commit is contained in:
@@ -28,6 +28,7 @@ export interface DisplayColumn {
|
|||||||
notNull?: boolean;
|
notNull?: boolean;
|
||||||
autoIncrement?: boolean;
|
autoIncrement?: boolean;
|
||||||
isPrimaryKey?: boolean;
|
isPrimaryKey?: boolean;
|
||||||
|
hasAutoValue?: boolean;
|
||||||
|
|
||||||
// NoSQL specific
|
// NoSQL specific
|
||||||
isPartitionKey?: boolean;
|
isPartitionKey?: boolean;
|
||||||
|
|||||||
@@ -266,6 +266,7 @@ export class TableGridDisplay extends GridDisplay {
|
|||||||
uniqueName,
|
uniqueName,
|
||||||
uniquePath,
|
uniquePath,
|
||||||
isPrimaryKey: table.primaryKey && !!table.primaryKey.columns.find(x => x.columnName == col.columnName),
|
isPrimaryKey: table.primaryKey && !!table.primaryKey.columns.find(x => x.columnName == col.columnName),
|
||||||
|
hasAutoValue: col.hasAutoValue,
|
||||||
foreignKey:
|
foreignKey:
|
||||||
table.foreignKeys &&
|
table.foreignKeys &&
|
||||||
table.foreignKeys.find(fk => fk.columns.length == 1 && fk.columns[0].columnName == col.columnName),
|
table.foreignKeys.find(fk => fk.columns.length == 1 && fk.columns[0].columnName == col.columnName),
|
||||||
|
|||||||
1
packages/types/dbinfo.d.ts
vendored
1
packages/types/dbinfo.d.ts
vendored
@@ -66,6 +66,7 @@ export interface ColumnInfo extends NamedObjectInfo {
|
|||||||
options?: [];
|
options?: [];
|
||||||
canSelectMultipleOptions?: boolean;
|
canSelectMultipleOptions?: boolean;
|
||||||
undropColumnName?: string;
|
undropColumnName?: string;
|
||||||
|
hasAutoValue?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DatabaseObjectInfo extends NamedObjectInfo {
|
export interface DatabaseObjectInfo extends NamedObjectInfo {
|
||||||
|
|||||||
@@ -615,6 +615,7 @@
|
|||||||
if (column.uniquePath.length > 1) continue;
|
if (column.uniquePath.length > 1) continue;
|
||||||
if (column.autoIncrement) continue;
|
if (column.autoIncrement) continue;
|
||||||
if (column.isClusterKey) continue;
|
if (column.isClusterKey) continue;
|
||||||
|
if (column.hasAutoValue) continue;
|
||||||
|
|
||||||
grider.setCellValue(rowIndex, column.uniqueName, grider.getRowData(index)[column.uniqueName]);
|
grider.setCellValue(rowIndex, column.uniqueName, grider.getRowData(index)[column.uniqueName]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ function getColumnInfo({
|
|||||||
defaultValue,
|
defaultValue,
|
||||||
defaultConstraint,
|
defaultConstraint,
|
||||||
computedExpression: simplifyComutedExpression(computedExpression),
|
computedExpression: simplifyComutedExpression(computedExpression),
|
||||||
|
hasAutoValue: !!(dataType == 'timestamp' || dataType == 'rowversion' || computedExpression),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user