You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "maishivamhoo123 (via GitHub)" <gi...@apache.org> on 2026/02/06 16:43:38 UTC
[PR] fix: change avatar column type to TEXT to support long URLs [answer]
maishivamhoo123 opened a new pull request, #1499:
URL: https://github.com/apache/answer/pull/1499
### Type of change
- [x] Bug fix
#1498
### Description
This PR changes the `avatar` column type from `VARCHAR` to `TEXT` in the `user` table.
**Reason:**
Some Google profile image URLs exceed the previous character limit (1024/2048 chars), causing 500 errors during login or registration. Switching to `TEXT` ensures support for long URLs (up to 65kb).
### Changes
1. **Entity:** Updated `User` struct in `internal/entity/user_entity.go` to use `TEXT` for the avatar field.
2. **Migration:** Added `v1.8.2` migration (`internal/migrations/v32.go`) to alter the database column automatically.
### Verification
- Tested locally with MySQL.
- Verified that inserting a string longer than 2048 characters into the `avatar` column now succeeds without error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on PR #1499:
URL: https://github.com/apache/answer/pull/1499#issuecomment-3869173582
@maishivamhoo123 After testing, we found an error. This is an error encountered during testing with MySQL. You may need to verify whether the migration works correctly for different database types.
`migrate failed: sync user table failed: Error 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column 'avatar' can't have a default value`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "maishivamhoo123 (via GitHub)" <gi...@apache.org>.
maishivamhoo123 commented on PR #1499:
URL: https://github.com/apache/answer/pull/1499#issuecomment-3861621118
@LinkinStars @team can you please review the code.
Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on code in PR #1499:
URL: https://github.com/apache/answer/pull/1499#discussion_r2780488094
##########
internal/migrations/migrations.go:
##########
@@ -107,6 +107,7 @@ var migrations = []Migration{
NewMigration("v1.7.2", "expand avatar column length", expandAvatarColumnLength, false),
NewMigration("v1.8.0", "change admin menu", updateAdminMenuSettings, true),
NewMigration("v1.8.1", "ai feat", aiFeat, true),
+ NewMigration("v1.8.2", "change avatar type to text", updateAvatarType, false),
Review Comment:
This version number should be v2.0.1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "maishivamhoo123 (via GitHub)" <gi...@apache.org>.
maishivamhoo123 commented on PR #1499:
URL: https://github.com/apache/answer/pull/1499#issuecomment-3877821642
@LinkinStars can you please for approve for workflows
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on PR #1499:
URL: https://github.com/apache/answer/pull/1499#issuecomment-3882200063
> @LinkinStars can you please for approve for workflows
Approved. This PR will be merged in future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars merged PR #1499:
URL: https://github.com/apache/answer/pull/1499
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [PR] fix: change avatar column type to TEXT to support long URLs [answer]
Posted by "maishivamhoo123 (via GitHub)" <gi...@apache.org>.
maishivamhoo123 commented on PR #1499:
URL: https://github.com/apache/answer/pull/1499#issuecomment-3869847477
> @maishivamhoo123 After testing, we found an error. This is an error encountered during testing with MySQL. You may need to verify whether the migration works correctly for different database types. `migrate failed: sync user table failed: Error 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column 'avatar' can't have a default value`
@LinkinStars sir i have migrated the version to v2.0.1 and i removed the default tag from Avatar .
can you please review the new PR thank you sir.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org