diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs index 21c6e95b..933276e9 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs @@ -38,15 +38,6 @@ namespace OpenIddict.EntityFrameworkCore // Entity Framework would throw an exception due to the TKey generic parameter // being non-nullable when using value types like short, int, long or Guid. - // If primary/foreign keys are strings, limit their length to ensure - // they can be safely used in indexes, specially when the underlying - // provider is known to not restrict the default length (e.g MySQL). - if (typeof(TKey) == typeof(string)) - { - builder.Property(application => application.Id) - .HasMaxLength(50); - } - builder.HasKey(application => application.Id); builder.HasIndex(application => application.ClientId) diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs index 9f1677f7..e4ca3a51 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs @@ -38,19 +38,6 @@ namespace OpenIddict.EntityFrameworkCore // Entity Framework would throw an exception due to the TKey generic parameter // being non-nullable when using value types like short, int, long or Guid. - // If primary/foreign keys are strings, limit their length to ensure - // they can be safely used in indexes, specially when the underlying - // provider is known to not restrict the default length (e.g MySQL). - if (typeof(TKey) == typeof(string)) - { - builder.Property(typeof(string), nameof(OpenIddictAuthorization.Application) + - nameof(OpenIddictApplication.Id)) - .HasMaxLength(50); - - builder.Property(application => application.Id) - .HasMaxLength(50); - } - builder.HasKey(authorization => authorization.Id); builder.HasIndex( diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictScopeConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictScopeConfiguration.cs index 7c390a85..9153e0e0 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictScopeConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictScopeConfiguration.cs @@ -34,15 +34,6 @@ namespace OpenIddict.EntityFrameworkCore // Entity Framework would throw an exception due to the TKey generic parameter // being non-nullable when using value types like short, int, long or Guid. - // If primary/foreign keys are strings, limit their length to ensure - // they can be safely used in indexes, specially when the underlying - // provider is known to not restrict the default length (e.g MySQL). - if (typeof(TKey) == typeof(string)) - { - builder.Property(scope => scope.Id) - .HasMaxLength(50); - } - builder.HasKey(scope => scope.Id); builder.HasIndex(scope => scope.Name) diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs index dd2f9c2d..e8168cfb 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs @@ -38,24 +38,6 @@ namespace OpenIddict.EntityFrameworkCore // Entity Framework would throw an exception due to the TKey generic parameter // being non-nullable when using value types like short, int, long or Guid. - - // If primary/foreign keys are strings, limit their length to ensure - // they can be safely used in indexes, specially when the underlying - // provider is known to not restrict the default length (e.g MySQL). - if (typeof(TKey) == typeof(string)) - { - builder.Property(typeof(string), nameof(OpenIddictToken.Application) + - nameof(OpenIddictApplication.Id)) - .HasMaxLength(50); - - builder.Property(typeof(string), nameof(OpenIddictToken.Authorization) + - nameof(OpenIddictApplication.Id)) - .HasMaxLength(50); - - builder.Property(token => token.Id) - .HasMaxLength(50); - } - builder.HasKey(token => token.Id); builder.HasIndex(token => token.ReferenceId)