#1111 mssql - handle timestamp and computed columns in clonerows

This commit is contained in:
SPRINX0\prochazka
2025-06-11 11:28:46 +02:00
parent 34bdb72ffd
commit 0146e4a1dd
5 changed files with 5 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ export interface DisplayColumn {
notNull?: boolean;
autoIncrement?: boolean;
isPrimaryKey?: boolean;
hasAutoValue?: boolean;
// NoSQL specific
isPartitionKey?: boolean;

View File

@@ -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),

View File

@@ -66,6 +66,7 @@ export interface ColumnInfo extends NamedObjectInfo {
options?: [];
canSelectMultipleOptions?: boolean;
undropColumnName?: string;
hasAutoValue?: boolean;
}
export interface DatabaseObjectInfo extends NamedObjectInfo {

View File

@@ -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]);
}

View File

@@ -78,6 +78,7 @@ function getColumnInfo({
defaultValue,
defaultConstraint,
computedExpression: simplifyComutedExpression(computedExpression),
hasAutoValue: !!(dataType == 'timestamp' || dataType == 'rowversion' || computedExpression),
};
}