mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core: chat hooks allowing to extend or customize chat core (#3953)
* core: chat hooks allowing to extend or customize chat core * update * json * custom response * user in db queries
This commit is contained in:
committed by
GitHub
parent
735359c279
commit
86fe28f1ed
@@ -0,0 +1,20 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20240324_custom_data where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20240324_custom_data :: Query
|
||||
m20240324_custom_data =
|
||||
[sql|
|
||||
ALTER TABLE contacts ADD COLUMN custom_data BLOB;
|
||||
ALTER TABLE groups ADD COLUMN custom_data BLOB;
|
||||
|]
|
||||
|
||||
down_m20240324_custom_data :: Query
|
||||
down_m20240324_custom_data =
|
||||
[sql|
|
||||
ALTER TABLE contacts DROP COLUMN custom_data;
|
||||
ALTER TABLE groups DROP COLUMN custom_data;
|
||||
|]
|
||||
@@ -73,6 +73,7 @@ CREATE TABLE contacts(
|
||||
REFERENCES group_members(group_member_id) ON DELETE SET NULL,
|
||||
contact_grp_inv_sent INTEGER NOT NULL DEFAULT 0,
|
||||
contact_status TEXT NOT NULL DEFAULT 'active',
|
||||
custom_data BLOB,
|
||||
FOREIGN KEY(user_id, local_display_name)
|
||||
REFERENCES display_names(user_id, local_display_name)
|
||||
ON DELETE CASCADE
|
||||
@@ -120,7 +121,8 @@ CREATE TABLE groups(
|
||||
favorite INTEGER NOT NULL DEFAULT 0,
|
||||
send_rcpts INTEGER,
|
||||
via_group_link_uri_hash BLOB,
|
||||
user_member_profile_sent_at TEXT, -- received
|
||||
user_member_profile_sent_at TEXT,
|
||||
custom_data BLOB, -- received
|
||||
FOREIGN KEY(user_id, local_display_name)
|
||||
REFERENCES display_names(user_id, local_display_name)
|
||||
ON DELETE CASCADE
|
||||
|
||||
Reference in New Issue
Block a user