mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Invalidate cached configuration when path changes
The nhibernate configuration stores the physical path to the SqlCe database so we need to include the physical location as part of the hash key, so that xcopy migrations work as expected. Work Item: 17159 --HG-- branch : 1.x
This commit is contained in:
@@ -104,12 +104,20 @@ namespace Orchard.Data {
|
||||
private Hash ComputeHash() {
|
||||
var hash = new Hash();
|
||||
|
||||
// Shell settings physical location
|
||||
// The nhibernate configuration stores the physical path to the SqlCe database
|
||||
// so we need to include the physical location as part of the hash key, so that
|
||||
// xcopy migrations work as expected.
|
||||
var pathName = GetPathName(_shellSettings.Name);
|
||||
hash.AddString(_appDataFolder.MapPath(pathName).ToLowerInvariant());
|
||||
|
||||
// Shell settings data
|
||||
hash.AddString(_shellSettings.DataProvider);
|
||||
hash.AddString(_shellSettings.DataTablePrefix);
|
||||
hash.AddString(_shellSettings.DataConnectionString);
|
||||
hash.AddString(_shellSettings.Name);
|
||||
|
||||
// We need to hash the assemnly names, record names and property names
|
||||
// Assembly names, record names and property names
|
||||
foreach (var tableName in _shellBlueprint.Records.Select(x => x.TableName)) {
|
||||
hash.AddString(tableName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user