Fix MySQL index key too long for ResourcePermissionGrant#25495
Merged
Conversation
Shorten ResourceName/ResourceKey to 128 on MySQL so the composite unique index fits the InnoDB 3072 bytes limit under utf8mb4.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses MySQL initial migration failures for ResourcePermissionGrant by reducing indexed resource column lengths only when the EF Core model is configured for MySQL.
Changes:
- Adds MySQL-specific max-length values for
ResourceNameandResourceKey. - Keeps existing default lengths for non-MySQL providers.
- Targets the composite unique index that exceeds MySQL’s utf8mb4 index key limit.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #25495 +/- ##
==========================================
+ Coverage 49.40% 49.42% +0.01%
==========================================
Files 3670 3670
Lines 123599 123604 +5
Branches 9453 9455 +2
==========================================
+ Hits 61068 61090 +22
+ Misses 60711 60689 -22
- Partials 1820 1825 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
EngincanV
approved these changes
Jun 1, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating a new MySQL app fails on the initial EF Core migration with "Specified key was too long; max key length is 3072 bytes". The
ResourcePermissionGrant6-column unique index reaches 3108 bytes under utf8mb4. ShortenResourceName/ResourceKeyto 128 on MySQL only so the index fits the 3072 limit; other databases keep 256.Resolves #25492