fix: expand avatar column length from 1024 to 2048 #1463
+39 −1
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.
Summary
Expand the
avatarcolumn length fromVARCHAR(1024)toVARCHAR(2048)to fix login failures when using external OAuth providers.Problem
When users log in via the connector-google plugin, the Google profile picture URL can exceed 1024 characters, causing a database error:
Example of Affected Data
The actual data that caused the error (1168 characters total, exceeding 1024 limit):
{ "type": "custom", "gravatar": "", "custom": "https://lh3.googleusercontent.com/a-/ALV-UjUK6Q9fONacb_zlEtkCBHH6mH_FCRaZOEMMgpm0IPv8mullFBjetpocye17fKnJn4i1eH-w_nrpt3eSbEVpN3FfaBGPu7t9kAxkxJf7MBi8lRf8LnsaYudvXdS6l5L_3Ay9ZoP-C1lHvv-q_jdRVxME4uKOoZhLlFniuI9t6WV_gruIDPUxjw9yc7bFVIDwKVHRpeLLEKC2512ztK9ex-Pc-l--AXlQvj7d70iTKaDrKh9YZQo1XPa1ZJ2tMUoIDyCZp2rveEFrOYKIn8pVmNePmNriOi7tsz2-PkT9dQkWIoCrVGcsnDgWuZ3QENvc-CLGcVPp1tk_djWnT-aScua4AaxsfNd0JVtKA9Qxo3OFvINqDelnCA10X59szzjbReyEtYUbcVp75aohxWe_NyS0AYEWvmlSMhEoIpPYLd4PJT-HtUZNsmPIQvaI5n22oIIolz3mbPrrhLACkheDQ4FY480DpQNf7SJlbmjMxjrJoMI3Llnu9ILdwPOpBgpJ03h6ROUyvFgAOkTlnMrAierzVcfqPOnoWeH1ztSpuJtwTGDvczjYUpduhxFvnWmXnEZ_AHkv-qrFDFUEqQksNgVoUEJq3V2tbbtqT27WVojyLXAqIPhG0BGhytRnbzCqzfUDLtczdJzo5Rs-hE3C0K0uwnYTnRWfxHd6Xp1j6OuE8G8ijhh4PQXtHUxtxjYtZTVkGteQRzWAkmyPRbgY51sY5YVL89cx3HAsBGnSL0gFz0HPXJ_4HpJ4zoVJhwlQcPevnrScJvy6LNDziedWpO1gralK_Hxsp7Nf9Hc4am_0AFBzDwqX-zPj8eCQ_pofHfdjrC6sXvcgJ9s488IclEjDcTelZZNhabnPlT4gXSkW1tguJZtQO-6GO8qA1se_D_dQ04_h4PwKADj4y1Hiqo2TiB6tjSt01JyOaColdJ62GSBJbrdoX2SGogvGQn7bUU_dQGG7MK6OvU8OF-4vfdyOQrK-UVnUvAKcEHv90QaOYhgbr8Q8deiu2fNeK6ADlo5c1Qti2UiXvTbwhllNZvPV6k4peYXKy-xUq0msGDNlsFncndeTKw=s96-c" }Note: The
/a-/ALV-...URL format (used by some Google Workspace accounts) generates significantly longer URLs than the standard/a/ACg8oc...format (~120 characters).Solution
avatarcolumn fromVARCHAR(1024)toVARCHAR(2048)Notes
While URLs can technically exceed 2048 characters per specification, 2048 is the practical limit supported by most browsers and services. URLs longer than 2048 characters are extremely rare in real-world usage.
Changes
internal/entity/user_entity.go: Update avatar column definitioninternal/migrations/v29.go: Add migration for existing databasesinternal/migrations/migrations.go: Register new migration