From f91cd3d2de6f697ce54816088d2cb7b46eec09d5 Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Fri, 28 Feb 2025 20:43:37 +0400 Subject: [PATCH] schema --- .../Store/SQLite/Migrations/chat_schema.sql | 19 ++++++++++--------- tests/SchemaDump.hs | 4 +++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Simplex/Chat/Store/SQLite/Migrations/chat_schema.sql b/src/Simplex/Chat/Store/SQLite/Migrations/chat_schema.sql index 38eb90649f..d48806e953 100644 --- a/src/Simplex/Chat/Store/SQLite/Migrations/chat_schema.sql +++ b/src/Simplex/Chat/Store/SQLite/Migrations/chat_schema.sql @@ -316,7 +316,7 @@ CREATE TABLE user_contact_links( group_link_id BLOB, group_link_member_role TEXT NULL, business_address INTEGER DEFAULT 0, - group_link_auto_accept TEXT NULL, + group_link_auto_accept TEXT, UNIQUE(user_id, local_display_name) ); CREATE TABLE contact_requests( @@ -983,14 +983,6 @@ CREATE INDEX idx_chat_items_groups_msg_content_tag_deleted ON chat_items( item_deleted, item_sent ); -CREATE INDEX idx_chat_items_groups_history ON chat_items( - user_id, - group_id, - include_in_history, - item_deleted, - item_ts, - chat_item_id -); CREATE INDEX idx_group_snd_item_statuses_chat_item_id_group_member_id ON group_snd_item_statuses( chat_item_id, group_member_id @@ -1019,3 +1011,12 @@ CREATE INDEX idx_chat_items_group_id_shared_msg_id ON chat_items( group_id, shared_msg_id ); +CREATE INDEX idx_chat_items_groups_history ON chat_items( + user_id, + group_id, + include_in_history, + item_deleted, + group_member_id, + item_ts, + chat_item_id +); diff --git a/tests/SchemaDump.hs b/tests/SchemaDump.hs index 6c429e2a56..807fa4a0cb 100644 --- a/tests/SchemaDump.hs +++ b/tests/SchemaDump.hs @@ -125,7 +125,9 @@ skipComparisonForDownMigrations = -- indexes move down to the end of the file "20241125_indexes", -- indexes move down to the end of the file - "20250130_indexes" + "20250130_indexes", + -- index moves down to the end of the file + "20250227_member_acceptance" ] getSchema :: FilePath -> FilePath -> IO String