mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: group snd status (#2763)
* core: group snd status * schema, implementation * refactor direct, tests * configure, tests * item info * refactor * refactor * remove do * rename * remove receipts on events * refactor * refactor * refactor * refactor * tests * rename tests * aggregates * fix name * refactor --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20230721_group_snd_item_statuses where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20230721_group_snd_item_statuses :: Query
|
||||
m20230721_group_snd_item_statuses =
|
||||
[sql|
|
||||
CREATE TABLE group_snd_item_statuses (
|
||||
group_snd_item_status_id INTEGER PRIMARY KEY,
|
||||
chat_item_id INTEGER NOT NULL REFERENCES chat_items ON DELETE CASCADE,
|
||||
group_member_id INTEGER NOT NULL REFERENCES group_members ON DELETE CASCADE,
|
||||
group_snd_item_status TEXT NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT(datetime('now')),
|
||||
updated_at TEXT NOT NULL DEFAULT(datetime('now'))
|
||||
);
|
||||
|
||||
CREATE INDEX idx_group_snd_item_statuses_chat_item_id ON group_snd_item_statuses(chat_item_id);
|
||||
CREATE INDEX idx_group_snd_item_statuses_group_member_id ON group_snd_item_statuses(group_member_id);
|
||||
|
||||
UPDATE users SET send_rcpts_small_groups = 1 WHERE send_rcpts_contacts = 1;
|
||||
|]
|
||||
|
||||
down_m20230721_group_snd_item_statuses :: Query
|
||||
down_m20230721_group_snd_item_statuses =
|
||||
[sql|
|
||||
DROP INDEX idx_group_snd_item_statuses_group_member_id;
|
||||
DROP INDEX idx_group_snd_item_statuses_chat_item_id;
|
||||
|
||||
DROP TABLE group_snd_item_statuses;
|
||||
|]
|
||||
@@ -496,6 +496,14 @@ CREATE TABLE chat_item_moderations(
|
||||
created_at TEXT NOT NULL DEFAULT(datetime('now')),
|
||||
updated_at TEXT NOT NULL DEFAULT(datetime('now'))
|
||||
);
|
||||
CREATE TABLE group_snd_item_statuses(
|
||||
group_snd_item_status_id INTEGER PRIMARY KEY,
|
||||
chat_item_id INTEGER NOT NULL REFERENCES chat_items ON DELETE CASCADE,
|
||||
group_member_id INTEGER NOT NULL REFERENCES group_members ON DELETE CASCADE,
|
||||
group_snd_item_status TEXT NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT(datetime('now')),
|
||||
updated_at TEXT NOT NULL DEFAULT(datetime('now'))
|
||||
);
|
||||
CREATE INDEX contact_profiles_index ON contact_profiles(
|
||||
display_name,
|
||||
full_name
|
||||
@@ -687,3 +695,9 @@ CREATE INDEX idx_chat_item_moderations_group ON chat_item_moderations(
|
||||
item_member_id,
|
||||
shared_msg_id
|
||||
);
|
||||
CREATE INDEX idx_group_snd_item_statuses_chat_item_id ON group_snd_item_statuses(
|
||||
chat_item_id
|
||||
);
|
||||
CREATE INDEX idx_group_snd_item_statuses_group_member_id ON group_snd_item_statuses(
|
||||
group_member_id
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user