mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 03:51:48 +00:00
core: fix deleting user with chat tags (#6374)
* core: fix deleting user with chat tags * schema, tests * schema * update simplexmq * update ios * plans
This commit is contained in:
@@ -20,6 +20,7 @@ import Simplex.Chat.Store.Postgres.Migrations.M20250813_delivery_tasks
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20250919_group_summary
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20250922_remove_unused_connections
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20251007_connections_sync
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20251017_chat_tags_cascade
|
||||
import Simplex.Messaging.Agent.Store.Shared (Migration (..))
|
||||
|
||||
schemaMigrations :: [(String, Text, Maybe Text)]
|
||||
@@ -39,7 +40,8 @@ schemaMigrations =
|
||||
("20250813_delivery_tasks", m20250813_delivery_tasks, Just down_m20250813_delivery_tasks),
|
||||
("20250919_group_summary", m20250919_group_summary, Just down_m20250919_group_summary),
|
||||
("20250922_remove_unused_connections", m20250922_remove_unused_connections, Just down_m20250922_remove_unused_connections),
|
||||
("20251007_connections_sync", m20251007_connections_sync, Just down_m20251007_connections_sync)
|
||||
("20251007_connections_sync", m20251007_connections_sync, Just down_m20251007_connections_sync),
|
||||
("20251017_chat_tags_cascade", m20251017_chat_tags_cascade, Just down_m20251017_chat_tags_cascade)
|
||||
]
|
||||
|
||||
-- | The list of migrations in ascending order by date
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20251017_chat_tags_cascade where
|
||||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Text.RawString.QQ (r)
|
||||
|
||||
m20251017_chat_tags_cascade :: Text
|
||||
m20251017_chat_tags_cascade =
|
||||
T.pack
|
||||
[r|
|
||||
ALTER TABLE chat_tags DROP CONSTRAINT chat_tags_user_id_fkey;
|
||||
|
||||
ALTER TABLE chat_tags
|
||||
ADD CONSTRAINT chat_tags_user_id_fkey
|
||||
FOREIGN KEY (user_id)
|
||||
REFERENCES users(user_id)
|
||||
ON DELETE CASCADE;
|
||||
|]
|
||||
|
||||
down_m20251017_chat_tags_cascade :: Text
|
||||
down_m20251017_chat_tags_cascade =
|
||||
T.pack
|
||||
[r|
|
||||
ALTER TABLE chat_tags DROP CONSTRAINT chat_tags_user_id_fkey;
|
||||
|
||||
ALTER TABLE chat_tags
|
||||
ADD CONSTRAINT chat_tags_user_id_fkey
|
||||
FOREIGN KEY (user_id)
|
||||
REFERENCES users(user_id);
|
||||
|]
|
||||
@@ -2479,7 +2479,7 @@ ALTER TABLE ONLY test_chat_schema.chat_tags_chats
|
||||
|
||||
|
||||
ALTER TABLE ONLY test_chat_schema.chat_tags
|
||||
ADD CONSTRAINT chat_tags_user_id_fkey FOREIGN KEY (user_id) REFERENCES test_chat_schema.users(user_id);
|
||||
ADD CONSTRAINT chat_tags_user_id_fkey FOREIGN KEY (user_id) REFERENCES test_chat_schema.users(user_id) ON DELETE CASCADE;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user