Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace IDataMigrationManager.UpdateAsync(string) with IDataMigrationManager.UpdateAsync(IEnumerable<string>) #15909

Merged
merged 7 commits into from May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -22,13 +22,13 @@ public interface IDataMigrationManager
/// Updates the database to the latest version for the specified feature.
/// </summary>
/// <param name="feature">The feature to be uninstalled.</param>
Task UpdateAsync(string feature);
Task UpdateAsync(string feature) => UpdateAsync([feature]);
hishamco marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Updates the database to the latest version for the specified features.
/// Updates the database to the latest version for the specified feature(s).
/// </summary>
/// <param name="features">The features to be updated.</param>
Task UpdateAsync(IEnumerable<string> features);
/// <param name="features">The feature(s) to be updated.</param>
Task UpdateAsync(params string[] features);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this is a breaking change, but it's not something that anybody should actually notice.


/// <summary>
/// Execute a script to delete any information relative to the feature.
Expand Down
Expand Up @@ -123,7 +123,7 @@ public async Task Uninstall(string feature)
}
}

public async Task UpdateAsync(IEnumerable<string> featureIds)
public async Task UpdateAsync(params string[] featureIds)
{
foreach (var featureId in featureIds)
{
Expand All @@ -134,7 +134,7 @@ public async Task UpdateAsync(IEnumerable<string> featureIds)
}
}

public async Task UpdateAsync(string featureId)
private async Task UpdateAsync(string featureId)
{
if (_processedFeatures.Contains(featureId))
{
Expand All @@ -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);

Expand Down