diff --git a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictApplicationConfiguration.cs index b766df87..57c4c05c 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 a9906c63..c32295cf 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictAuthorizationConfiguration.cs @@ -38,18 +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(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 4acddc7b..b9389668 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 3af9b181..7e3ff800 100644 --- a/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs +++ b/src/OpenIddict.EntityFrameworkCore/Configurations/OpenIddictTokenConfiguration.cs @@ -38,22 +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(nameof(OpenIddictToken.Application) + nameof(OpenIddictApplication.Id)) - .HasMaxLength(50); - - builder.Property(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)