-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to specify a target migration in Migrate call Warn on Migrate when there are pending model changes Fixes #17568 Fixes #33732 Fixes #34196
- Loading branch information
1 parent
b981879
commit f0fbcbe
Showing
25 changed files
with
855 additions
and
139 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/EFCore.Relational/Diagnostics/MigrationCommandEventData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Diagnostics; | ||
|
||
/// <summary> | ||
/// The <see cref="DiagnosticSource" /> event payload for | ||
/// <see cref="RelationalEventId" /> events of a specific migration. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-diagnostics">Logging, events, and diagnostics</see> for more information and examples. | ||
/// </remarks> | ||
public class MigrationCommandEventData : MigratorEventData | ||
{ | ||
/// <summary> | ||
/// Constructs the event payload. | ||
/// </summary> | ||
/// <param name="eventDefinition">The event definition.</param> | ||
/// <param name="messageGenerator">A delegate that generates a log message for this event.</param> | ||
/// <param name="migrator"> | ||
/// The <see cref="IMigrator" /> in use. | ||
/// </param> | ||
/// <param name="migration"> | ||
/// The <see cref="Migration" /> being processed. | ||
/// </param> | ||
/// <param name="command"> | ||
/// The <see cref="MigrationCommand" /> being processed. | ||
/// </param> | ||
public MigrationCommandEventData( | ||
EventDefinitionBase eventDefinition, | ||
Func<EventDefinitionBase, EventData, string> messageGenerator, | ||
IMigrator migrator, | ||
Migration migration, | ||
MigrationCommand command) | ||
: base(eventDefinition, messageGenerator, migrator) | ||
{ | ||
Migration = migration; | ||
MigrationCommand = command; | ||
} | ||
|
||
/// <summary> | ||
/// The <see cref="Migration" /> being processed. | ||
/// </summary> | ||
public virtual Migration Migration { get; } | ||
|
||
/// <summary> | ||
/// The <see cref="MigrationCommand" /> being processed. | ||
/// </summary> | ||
public virtual MigrationCommand MigrationCommand { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.