[Fixes #6783] Workaround for PostgreSQL without breaking SQL server

This commit is contained in:
jtkech
2016-07-21 12:48:49 -07:00
committed by Sébastien Ros
parent 89a84cd00f
commit 8cd1778a80
@@ -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();
}
}
}