mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: deleted timestamps for chat item (#2459)
* core: edited and deleted timestamps for item * migration * add deleted timestamp to chat item, use chat item if there are no versions * use broker timestamp for remote deletions * refactor
This commit is contained in:
committed by
GitHub
parent
f155611d29
commit
9978957e6c
@@ -0,0 +1,18 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20230519_item_deleted_ts where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20230519_item_deleted_ts :: Query
|
||||
m20230519_item_deleted_ts =
|
||||
[sql|
|
||||
ALTER TABLE chat_items ADD COLUMN item_deleted_ts TEXT;
|
||||
|]
|
||||
|
||||
down_m20230519_item_deleted_ts :: Query
|
||||
down_m20230519_item_deleted_ts =
|
||||
[sql|
|
||||
ALTER TABLE chat_items DROP COLUMN item_deleted_ts;
|
||||
|]
|
||||
@@ -377,7 +377,8 @@ CREATE TABLE chat_items(
|
||||
timed_ttl INTEGER,
|
||||
timed_delete_at TEXT,
|
||||
item_live INTEGER,
|
||||
item_deleted_by_group_member_id INTEGER REFERENCES group_members ON DELETE SET NULL
|
||||
item_deleted_by_group_member_id INTEGER REFERENCES group_members ON DELETE SET NULL,
|
||||
item_deleted_ts TEXT
|
||||
);
|
||||
CREATE TABLE chat_item_messages(
|
||||
chat_item_id INTEGER NOT NULL REFERENCES chat_items ON DELETE CASCADE,
|
||||
|
||||
Reference in New Issue
Block a user