feat(sharing): allow custom share IDs#2353
Open
MuelNova wants to merge 1 commit intoOpenListTeam:mainfrom
Open
feat(sharing): allow custom share IDs#2353MuelNova wants to merge 1 commit intoOpenListTeam:mainfrom
MuelNova wants to merge 1 commit intoOpenListTeam:mainfrom
Conversation
- Change sharing ID column from char(12) to varchar(64) - Add new_id field to UpdateSharingReq for renaming share IDs - Add ID validation (max 64 chars, alphanumeric/CJK/hyphens/underscores) - Add conflict check when updating share ID - Add customize_share_id permission (bit 15) Closes OpenListTeam#1806
jyxjjj
requested changes
Apr 11, 2026
jyxjjj
approved these changes
Apr 11, 2026
Member
jyxjjj
left a comment
There was a problem hiding this comment.
I'm sorry for my mistake, I overlooked the AutoMigrate.
Author
Yes, GORM will handle this automatically. Thank you for your reviewing :D |
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.
Description / 描述
Allow users to set custom share IDs when creating or updating shares, instead of
being limited to random 8-12 character IDs.
Changes:
char(12)tovarchar(64)to support longer customIDs
new_idfield toUpdateSharingReqfor renaming existing share IDsunderscores, hyphens, and CJK characters
customize_share_idpermission (bit 15) to control which users can set customIDs
允许用户在创建或更新分享时设置自定义分享 ID,而不是只能使用随机生成的 8-12 位 ID。
Motivation and Context / 背景
Random share IDs like
aB3xK9mQare hard to remember. Custom IDs (e.g.my-photos,project-docs) make share links more readable and memorable.随机分享 ID 难以记忆,自定义 ID 让分享链接更易读、更好记。
Closes #1806
How Has This Been Tested? / 测试
AutoMigratecorrectly alters column fromchar(12)tovarchar(64)new_idfield in update requestcustomize_share_idpermission cannot setcustom IDs
Checklist / 检查清单
CONTRIBUTING
document.
go fmtor prettier.description if lacking permissions).
Labels needed:
enhancement,sharingfeature when applicable.