Upsert user-prefs rows by userId primary key.

Prevent duplicate @pearcord/user-prefs documents on insert so partial
writes can be repaired in place during startup recovery.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-02 11:43:50 -04:00
co-authored by Cursor
parent 0e7031fa16
commit 1c33a21602
+3
View File
@@ -116,6 +116,9 @@ class JsonStore {
if (collection.includes('guild-boost-ledger')) {
return { id: record.id }
}
if (collection.includes('user-prefs')) {
return { userId: record.userId }
}
return { id: record.id }
}