mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-09 16:41:47 +00:00
e05a35e26e
* postgres: modules structure (#5401) * postgres: schema, field conversions (#5430) * postgres: rework chat list pagination query (#5441) * prepare cabal for merge * restore cabal changes * simplexmq * postgres: implementation wip (tests don't pass) (#5481) * restore ios file * postgres: implementation - tests pass (#5487) * refactor DB options * refactor * line * style * style * refactor * $ * update simplexmq * constraintError * handleDBErrors * fix * remove param * Ok * case * case * case * comment --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
31 lines
822 B
Haskell
31 lines
822 B
Haskell
{-# LANGUAGE QuasiQuotes #-}
|
|
|
|
module Simplex.Chat.Store.SQLite.Migrations.M20230529_indexes where
|
|
|
|
import Database.SQLite.Simple (Query)
|
|
import Database.SQLite.Simple.QQ (sql)
|
|
|
|
m20230529_indexes :: Query
|
|
m20230529_indexes =
|
|
[sql|
|
|
DROP INDEX idx_chat_items_timed_delete_at;
|
|
|
|
CREATE INDEX idx_chat_items_timed_delete_at ON chat_items(user_id, timed_delete_at);
|
|
|
|
CREATE INDEX idx_group_members_group_id ON group_members(user_id, group_id);
|
|
|
|
CREATE INDEX idx_msg_deliveries_agent_ack_cmd_id ON msg_deliveries(connection_id, agent_ack_cmd_id);
|
|
|]
|
|
|
|
down_m20230529_indexes :: Query
|
|
down_m20230529_indexes =
|
|
[sql|
|
|
DROP INDEX idx_msg_deliveries_agent_ack_cmd_id;
|
|
|
|
DROP INDEX idx_group_members_group_id;
|
|
|
|
DROP INDEX idx_chat_items_timed_delete_at;
|
|
|
|
CREATE INDEX idx_chat_items_timed_delete_at ON chat_items(timed_delete_at);
|
|
|]
|