mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-11 01:57:20 +00:00
core: connection plan api; check connection plan before connecting in terminal api (#3176)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20231009_via_group_link_uri_hash where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20231009_via_group_link_uri_hash :: Query
|
||||
m20231009_via_group_link_uri_hash =
|
||||
[sql|
|
||||
CREATE INDEX idx_connections_conn_req_inv ON connections(conn_req_inv);
|
||||
|
||||
ALTER TABLE groups ADD COLUMN via_group_link_uri_hash BLOB;
|
||||
CREATE INDEX idx_groups_via_group_link_uri_hash ON groups(via_group_link_uri_hash);
|
||||
|]
|
||||
|
||||
down_m20231009_via_group_link_uri_hash :: Query
|
||||
down_m20231009_via_group_link_uri_hash =
|
||||
[sql|
|
||||
DROP INDEX idx_groups_via_group_link_uri_hash;
|
||||
ALTER TABLE groups DROP COLUMN via_group_link_uri_hash;
|
||||
|
||||
DROP INDEX idx_connections_conn_req_inv;
|
||||
|]
|
||||
@@ -117,7 +117,8 @@ CREATE TABLE groups(
|
||||
unread_chat INTEGER DEFAULT 0 CHECK(unread_chat NOT NULL),
|
||||
chat_ts TEXT,
|
||||
favorite INTEGER NOT NULL DEFAULT 0,
|
||||
send_rcpts INTEGER, -- received
|
||||
send_rcpts INTEGER,
|
||||
via_group_link_uri_hash BLOB, -- received
|
||||
FOREIGN KEY(user_id, local_display_name)
|
||||
REFERENCES display_names(user_id, local_display_name)
|
||||
ON DELETE CASCADE
|
||||
@@ -736,3 +737,7 @@ CREATE INDEX idx_received_probes_probe_hash ON received_probes(probe_hash);
|
||||
CREATE INDEX idx_sent_probes_created_at ON sent_probes(created_at);
|
||||
CREATE INDEX idx_sent_probe_hashes_created_at ON sent_probe_hashes(created_at);
|
||||
CREATE INDEX idx_received_probes_created_at ON received_probes(created_at);
|
||||
CREATE INDEX idx_connections_conn_req_inv ON connections(conn_req_inv);
|
||||
CREATE INDEX idx_groups_via_group_link_uri_hash ON groups(
|
||||
via_group_link_uri_hash
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user