Фикс бага с уникальными индексами сообщений

This commit is contained in:
RoyceDa
2026-02-16 19:28:36 +02:00
parent d02cb63ffe
commit 432b270b34
4 changed files with 17 additions and 7 deletions

View File

@@ -42,6 +42,11 @@ export const TABLES = [
attachments TEXT NOT NULL DEFAULT '[]',
UNIQUE (id)
)`,
/**
* Создаем индекс на столбцы message_id и public_key чтобы избежать дубликации сообщений при синхронизации
*/
`CREATE UNIQUE INDEX IF NOT EXISTS idx_messages_message_id_public_key ON messages(message_id, account)`,
`CREATE TABLE IF NOT EXISTS cached_users (
public_key TEXT PRIMARY KEY,