mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45: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;
|
||||
autoIncrement?: boolean;
|
||||
isPrimaryKey?: boolean;
|
||||
hasAutoValue?: boolean;
|
||||
|
||||
// NoSQL specific
|
||||
isPartitionKey?: boolean;
|
||||
|
||||
@@ -266,6 +266,7 @@ export class TableGridDisplay extends GridDisplay {
|
||||
uniqueName,
|
||||
uniquePath,
|
||||
isPrimaryKey: table.primaryKey && !!table.primaryKey.columns.find(x => x.columnName == col.columnName),
|
||||
hasAutoValue: col.hasAutoValue,
|
||||
foreignKey:
|
||||
table.foreignKeys &&
|
||||
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?: [];
|
||||
canSelectMultipleOptions?: boolean;
|
||||
undropColumnName?: string;
|
||||
hasAutoValue?: boolean;
|
||||
}
|
||||
|
||||
export interface DatabaseObjectInfo extends NamedObjectInfo {
|
||||
|
||||
@@ -615,6 +615,7 @@
|
||||
if (column.uniquePath.length > 1) continue;
|
||||
if (column.autoIncrement) continue;
|
||||
if (column.isClusterKey) continue;
|
||||
if (column.hasAutoValue) continue;
|
||||
|
||||
grider.setCellValue(rowIndex, column.uniqueName, grider.getRowData(index)[column.uniqueName]);
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ function getColumnInfo({
|
||||
defaultValue,
|
||||
defaultConstraint,
|
||||
computedExpression: simplifyComutedExpression(computedExpression),
|
||||
hasAutoValue: !!(dataType == 'timestamp' || dataType == 'rowversion' || computedExpression),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user