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

Remove quirk for #27059 #27147

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/EFCore.Relational/Metadata/IReadOnlyCheckConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ public interface IReadOnlyCheckConstraint : IReadOnlyAnnotatable
/// <param name="storeObject">The identifier of the store object.</param>
/// <returns>The default name that would be used for this check constraint.</returns>
string GetDefaultName(in StoreObjectIdentifier storeObject)
{
var prefix = $"CK_{storeObject.Name}_";
return Uniquifier.Truncate(
!(AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue27059", out var enabled) && enabled)
|| ModelName.StartsWith(prefix, StringComparison.Ordinal)
? ModelName
: prefix + ModelName,
EntityType.Model.GetMaxIdentifierLength());
}
=> Uniquifier.Truncate(ModelName, EntityType.Model.GetMaxIdentifierLength());

/// <summary>
/// Gets the entity type on which this check constraint is defined.
Expand Down