mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
[Fixes #6783] Workaround for PostgreSQL without breaking SQL server
This commit is contained in:
@@ -85,9 +85,16 @@ namespace Orchard.Data.Migration {
|
||||
var schemaBuilder = new SchemaBuilder(_dataMigrationInterpreter);
|
||||
var distributedLockSchemaBuilder = new DistributedLockSchemaBuilder(_shellSettings, schemaBuilder);
|
||||
if (!distributedLockSchemaBuilder.SchemaExists()) {
|
||||
|
||||
// Workaround to avoid some Transaction issue for PostgreSQL.
|
||||
_transactionManager.RequireNew();
|
||||
if (_shellSettings.DataProvider.Equals("PostgreSql", StringComparison.OrdinalIgnoreCase)) {
|
||||
_transactionManager.RequireNew();
|
||||
distributedLockSchemaBuilder.CreateSchema();
|
||||
return;
|
||||
}
|
||||
|
||||
distributedLockSchemaBuilder.CreateSchema();
|
||||
_transactionManager.RequireNew();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user