Skip to content

Conversation

@majiayu000
Copy link
Contributor

Summary

  • Adds a one-time data migration to normalize all existing memo tags to lowercase
  • Fixes duplicate tags issue where old memos have mixed-case tags (e.g., #House) while new memos use lowercase (#house)
  • Migration runs on server startup and is tracked via system_setting to prevent re-execution

Fixes #5363

Test plan

  • Tested with SQLite, MySQL, PostgreSQL databases
  • Verified migration only runs once
  • Verified tags are normalized to lowercase
  • All existing tests pass

Add a data migration that runs on server startup to normalize all
existing memo tags to lowercase. This prevents duplicate tags when
old memos have mixed-case tags (e.g., #House) while new memos
automatically use lowercase (e.g., #house).

The migration:
- Runs once and is tracked via system_setting
- Processes memos in batches to avoid memory issues
- Deduplicates tags during normalization
- Skips memos that already have lowercase tags

Fixes usememos#5363

Signed-off-by: majiayu000 <1835304752@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hashtags are being saved in lower case, leading to duplicate hashtags of the same name

1 participant