preloaded rows works with autoinc columns (fix for mssql)

This commit is contained in:
SPRINX0\prochazka
2024-08-29 10:53:56 +02:00
parent e982e8cd9b
commit c097e78dd0
5 changed files with 40 additions and 7 deletions

View File

@@ -94,6 +94,7 @@ interface AlterOperation_FillPreloadedRows {
newRows: any[];
key: string[];
insertOnly: string[];
autoIncrementColumn: string;
}
type AlterOperation =
@@ -233,7 +234,14 @@ export class AlterPlan {
this.recreates.tables += 1;
}
fillPreloadedRows(table: NamedObjectInfo, oldRows: any[], newRows: any[], key: string[], insertOnly: string[]) {
fillPreloadedRows(
table: NamedObjectInfo,
oldRows: any[],
newRows: any[],
key: string[],
insertOnly: string[],
autoIncrementColumn: string
) {
this.operations.push({
operationType: 'fillPreloadedRows',
table,
@@ -241,6 +249,7 @@ export class AlterPlan {
newRows,
key,
insertOnly,
autoIncrementColumn,
});
}
@@ -567,7 +576,7 @@ export function runAlterOperation(op: AlterOperation, processor: AlterProcessor)
processor.dropSqlObject(op.oldObject);
break;
case 'fillPreloadedRows':
processor.fillPreloadedRows(op.table, op.oldRows, op.newRows, op.key, op.insertOnly);
processor.fillPreloadedRows(op.table, op.oldRows, op.newRows, op.key, op.insertOnly, op.autoIncrementColumn);
break;
case 'recreateTable':
{