Open dream7180 opened 3 days ago
It looks like we already handle the empty reactions setting https://github.com/usememos/memos/commit/378b6a51c136f41e5df93453423b4d8c9855a666, so we can just remove the related migration scripts. @boojack
@dream7180, what db are you using? Is it MySQL?
yes. Mariadb (mysql)
What charset are you running on your db? You can find out by running the following script
SELECT @@character_set_database, @@collation_database
I believe you need to use utf8mb4
to allow for emoji chars
CHARACTER SET utf8 COLLATE utf8_general_ci
I have to convert charset to utf8mb4?
We can set the charset just for the required columns so that it doesn't matter what charset users chose when they created their db
If you cant wait for the code update, you can change the charset of your db instance, but please back up your db first just in case
PR submitted https://github.com/usememos/memos/pull/4131
Describe the bug
Archlinux, start failure, either pre-built binary or self-complied binary. message: 2024/11/13 18:14:28 ERROR failed to migrate error="Error 1366 (22007): Incorrect string value: '\xF0\x9F\x91\x8D\",...' for column
memos
.system_setting
.value
at row 1\nfailed to execute statement\ngithub.com/usememos/memos/store.(Store).execute\n\t/home/runner/work/memos/memos/store/migrator.go:251\ngithub.com/usememos/memos/store.(Store).Migrate\n\t/home/runner/work/memos/memos/store/migrator.go:88\nmain.init.func1\n\t/home/runner/work/memos/memos/bin/memos/main.go:61\ngithub.com/spf13/cobra.(Command).execute\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:989\ngithub.com/spf13/cobra.(Command).ExecuteC\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithub.com/spf13/cobra.(Command).Execute\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\nmain.main\n\t/home/runner/work/memos/memos/bin/memos/main.go:171\nruntime.main\n\t/opt/hostedtoolcache/go/1.23.3/x64/src/runtime/proc.go:272\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.23.3/x64/src/runtime/asm_amd64.s:1700\nmigrate error: UPDATEreaction
SETreaction_type
= '👍' WHEREreaction_type
= 'THUMBS_UP';\nUPDATEreaction
SETreaction_type
= '👎' WHEREreaction_type
= 'THUMBS_DOWN';\nUPDATEreaction
SETreaction_type
= '💛' WHEREreaction_type
= 'HEART';\nUPDATEreaction
SETreaction_type
= '🔥' WHEREreaction_type
= 'FIRE';\nUPDATEreaction
SETreaction_type
= '👏' WHEREreaction_type
= 'CLAPPING_HANDS';\nUPDATEreaction
SETreaction_type
= '😂' WHEREreaction_type
= 'LAUGH';\nUPDATEreaction
SETreaction_type
= '👌' WHEREreaction_type
= 'OK_HAND';\nUPDATEreaction
SETreaction_type
= '🚀' WHEREreaction_type
= 'ROCKET';\nUPDATEreaction
SETreaction_type
= '👀' WHEREreaction_type
= 'EYES';\nUPDATEreaction
SETreaction_type
= '🤔' WHEREreaction_type
= 'THINKING_FACE';\nUPDATEreaction
SETreaction_type
= '🤡' WHEREreaction_type
= 'CLOWN_FACE';\nUPDATEreaction
SETreaction_type
= '❓' WHEREreaction_type
= 'QUESTION_MARK';\n\nINSERT INTOsystem_setting
(name
,value
,description
)\nVALUES (\n 'MEMO_RELATED',\n '{\"contentLengthLimit\":8192,\"reactions\":[\"👍\",\"👎\",\"💛\",\"🔥\",\"👏\",\"😂\",\"👌\",\"🚀\",\"👀\",\"🤔\",\"🤡\",\"❓\"]}',\n ''\n)\nON DUPLICATE KEY UPDATE\nvalue = \n JSON_SET(\n value, \n '$.reactions', \n JSON_ARRAY('👍', '👎', '💛', '🔥', '👏', '😂', '👌', '🚀', '👀', '🤔', '🤡', '❓')\n );\n\ngithub.com/usememos/memos/store.(Store).Migrate\n\t/home/runner/work/memos/memos/store/migrator.go:89\nmain.init.func1\n\t/home/runner/work/memos/memos/bin/memos/main.go:61\ngithub.com/spf13/cobra.(Command).execute\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:989\ngithub.com/spf13/cobra.(Command).ExecuteC\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\t/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041\nmain.main\n\t/home/runner/work/memos/memos/bin/memos/main.go:171\nruntime.main\n\t/opt/hostedtoolcache/go/1.23.3/x64/src/runtime/proc.go:272\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.23.3/x64/src/runtime/asm_amd64.s:1700"Steps to reproduce
start memos as service.
The version of Memos you're using.
v0.23.0-rc.1
Screenshots or additional context
0.22.5 runs OK