diff --git a/src/OrchardCore/OrchardCore.Data.Abstractions/IDataMigrationManager.cs b/src/OrchardCore/OrchardCore.Data.Abstractions/IDataMigrationManager.cs index 80f070e968c..1082e5661f5 100644 --- a/src/OrchardCore/OrchardCore.Data.Abstractions/IDataMigrationManager.cs +++ b/src/OrchardCore/OrchardCore.Data.Abstractions/IDataMigrationManager.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -22,13 +23,14 @@ public interface IDataMigrationManager /// Updates the database to the latest version for the specified feature. /// /// The feature to be uninstalled. - Task UpdateAsync(string feature); + [Obsolete("This method has been deprecated, please use UpdateAsync(string[] features) instead.")] + Task UpdateAsync(string feature) => UpdateAsync([feature]); /// - /// Updates the database to the latest version for the specified features. + /// Updates the database to the latest version for the specified feature(s). /// - /// The features to be updated. - Task UpdateAsync(IEnumerable features); + /// The feature(s) to be updated. + Task UpdateAsync(params string[] features); /// /// Execute a script to delete any information relative to the feature. diff --git a/src/OrchardCore/OrchardCore.Data.YesSql/Migration/DataMigrationManager.cs b/src/OrchardCore/OrchardCore.Data.YesSql/Migration/DataMigrationManager.cs index 3a8530abaa4..594d72e1ad8 100644 --- a/src/OrchardCore/OrchardCore.Data.YesSql/Migration/DataMigrationManager.cs +++ b/src/OrchardCore/OrchardCore.Data.YesSql/Migration/DataMigrationManager.cs @@ -123,7 +123,7 @@ public async Task Uninstall(string feature) } } - public async Task UpdateAsync(IEnumerable featureIds) + public async Task UpdateAsync(params string[] featureIds) { foreach (var featureId in featureIds) { @@ -134,7 +134,7 @@ public async Task UpdateAsync(IEnumerable featureIds) } } - public async Task UpdateAsync(string featureId) + private async Task UpdateAsync(string featureId) { if (_processedFeatures.Contains(featureId)) { @@ -152,7 +152,10 @@ public async Task UpdateAsync(string featureId) .Where(x => x.Id != featureId) .Select(x => x.Id); - await UpdateAsync(dependencies); + foreach (var dependency in dependencies) + { + await UpdateAsync(dependency); + } var migrations = GetDataMigrations(featureId);