fixed undelete view for SQL server

This commit is contained in:
Jan Prochazka 2024-10-31 16:34:00 +01:00
parent 836d15c68f
commit 4ea763124b
2 changed files with 15 additions and 6 deletions

View File

@ -188,8 +188,8 @@ const filterLocal = [
// filter local testing
'-MySQL',
'-MariaDB',
'PostgreSQL',
'-SQL Server',
'-PostgreSQL',
'SQL Server',
'-SQLite',
'-CockroachDB',
'-ClickHouse',

View File

@ -647,10 +647,19 @@ export function createAlterDatabasePlan(
} else if (!opts.noDropSqlObject) {
plan.dropSqlObject(oldobj);
}
} else if (!testEqualSqlObjects(oldobj, newobj, opts)) {
plan.recreates.sqlObjects += 1;
plan.dropSqlObject(oldobj);
plan.createSqlObject(newobj);
} else {
if (
opts.deletedSqlObjectPrefix &&
driver.dialect.renameSqlObject &&
hasDeletedPrefix(oldobj.pureName, opts, opts.deletedSqlObjectPrefix)
) {
plan.dropSqlObject(oldobj);
plan.createSqlObject(newobj);
} else if (!testEqualSqlObjects(oldobj, newobj, opts)) {
plan.recreates.sqlObjects += 1;
plan.dropSqlObject(oldobj);
plan.createSqlObject(newobj);
}
}
}
}