{-# LANGUAGE NamedFieldPuns #-}
module Simplex.Chat.Store.SQLite.Migrations (migrations) where
import Data.List (sortOn)
import Database.SQLite.Simple (Query (..))
import Simplex.Chat.Store.SQLite.Migrations.M20220101_initial
import Simplex.Chat.Store.SQLite.Migrations.M20220122_v1_1
import Simplex.Chat.Store.SQLite.Migrations.M20220205_chat_item_status
import Simplex.Chat.Store.SQLite.Migrations.M20220210_deduplicate_contact_requests
import Simplex.Chat.Store.SQLite.Migrations.M20220224_messages_fks
import Simplex.Chat.Store.SQLite.Migrations.M20220301_smp_servers
import Simplex.Chat.Store.SQLite.Migrations.M20220302_profile_images
import Simplex.Chat.Store.SQLite.Migrations.M20220304_msg_quotes
import Simplex.Chat.Store.SQLite.Migrations.M20220321_chat_item_edited
import Simplex.Chat.Store.SQLite.Migrations.M20220404_files_status_fields
import Simplex.Chat.Store.SQLite.Migrations.M20220514_profiles_user_id
import Simplex.Chat.Store.SQLite.Migrations.M20220626_auto_reply
import Simplex.Chat.Store.SQLite.Migrations.M20220702_calls
import Simplex.Chat.Store.SQLite.Migrations.M20220715_groups_chat_item_id
import Simplex.Chat.Store.SQLite.Migrations.M20220811_chat_items_indices
import Simplex.Chat.Store.SQLite.Migrations.M20220812_incognito_profiles
import Simplex.Chat.Store.SQLite.Migrations.M20220818_chat_notifications
import Simplex.Chat.Store.SQLite.Migrations.M20220822_groups_host_conn_custom_user_profile_id
import Simplex.Chat.Store.SQLite.Migrations.M20220823_delete_broken_group_event_chat_items
import Simplex.Chat.Store.SQLite.Migrations.M20220824_profiles_local_alias
import Simplex.Chat.Store.SQLite.Migrations.M20220909_commands
import Simplex.Chat.Store.SQLite.Migrations.M20220926_connection_alias
import Simplex.Chat.Store.SQLite.Migrations.M20220928_settings
import Simplex.Chat.Store.SQLite.Migrations.M20221001_shared_msg_id_indices
import Simplex.Chat.Store.SQLite.Migrations.M20221003_delete_broken_integrity_error_chat_items
import Simplex.Chat.Store.SQLite.Migrations.M20221004_idx_msg_deliveries_message_id
import Simplex.Chat.Store.SQLite.Migrations.M20221011_user_contact_links_group_id
import Simplex.Chat.Store.SQLite.Migrations.M20221012_inline_files
import Simplex.Chat.Store.SQLite.Migrations.M20221019_unread_chat
import Simplex.Chat.Store.SQLite.Migrations.M20221021_auto_accept__group_links
import Simplex.Chat.Store.SQLite.Migrations.M20221024_contact_used
import Simplex.Chat.Store.SQLite.Migrations.M20221025_chat_settings
import Simplex.Chat.Store.SQLite.Migrations.M20221029_group_link_id
import Simplex.Chat.Store.SQLite.Migrations.M20221112_server_password
import Simplex.Chat.Store.SQLite.Migrations.M20221115_server_cfg
import Simplex.Chat.Store.SQLite.Migrations.M20221129_delete_group_feature_items
import Simplex.Chat.Store.SQLite.Migrations.M20221130_delete_item_deleted
import Simplex.Chat.Store.SQLite.Migrations.M20221209_verified_connection
import Simplex.Chat.Store.SQLite.Migrations.M20221210_idxs
import Simplex.Chat.Store.SQLite.Migrations.M20221211_group_description
import Simplex.Chat.Store.SQLite.Migrations.M20221212_chat_items_timed
import Simplex.Chat.Store.SQLite.Migrations.M20221214_live_message
import Simplex.Chat.Store.SQLite.Migrations.M20221222_chat_ts
import Simplex.Chat.Store.SQLite.Migrations.M20221223_idx_chat_items_item_status
import Simplex.Chat.Store.SQLite.Migrations.M20221230_idxs
import Simplex.Chat.Store.SQLite.Migrations.M20230107_connections_auth_err_counter
import Simplex.Chat.Store.SQLite.Migrations.M20230111_users_agent_user_id
import Simplex.Chat.Store.SQLite.Migrations.M20230117_fkey_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20230118_recreate_smp_servers
import Simplex.Chat.Store.SQLite.Migrations.M20230129_drop_chat_items_group_idx
import Simplex.Chat.Store.SQLite.Migrations.M20230206_item_deleted_by_group_member_id
import Simplex.Chat.Store.SQLite.Migrations.M20230303_group_link_role
import Simplex.Chat.Store.SQLite.Migrations.M20230317_hidden_profiles
import Simplex.Chat.Store.SQLite.Migrations.M20230318_file_description
import Simplex.Chat.Store.SQLite.Migrations.M20230321_agent_file_deleted
import Simplex.Chat.Store.SQLite.Migrations.M20230328_files_protocol
import Simplex.Chat.Store.SQLite.Migrations.M20230402_protocol_servers
import Simplex.Chat.Store.SQLite.Migrations.M20230411_extra_xftp_file_descriptions
import Simplex.Chat.Store.SQLite.Migrations.M20230420_rcv_files_to_receive
import Simplex.Chat.Store.SQLite.Migrations.M20230422_profile_contact_links
import Simplex.Chat.Store.SQLite.Migrations.M20230504_recreate_msg_delivery_events_cleanup_messages
import Simplex.Chat.Store.SQLite.Migrations.M20230505_chat_item_versions
import Simplex.Chat.Store.SQLite.Migrations.M20230511_reactions
import Simplex.Chat.Store.SQLite.Migrations.M20230519_item_deleted_ts
import Simplex.Chat.Store.SQLite.Migrations.M20230526_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20230529_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20230608_deleted_contacts
import Simplex.Chat.Store.SQLite.Migrations.M20230618_favorite_chats
import Simplex.Chat.Store.SQLite.Migrations.M20230621_chat_item_moderations
import Simplex.Chat.Store.SQLite.Migrations.M20230705_delivery_receipts
import Simplex.Chat.Store.SQLite.Migrations.M20230721_group_snd_item_statuses
import Simplex.Chat.Store.SQLite.Migrations.M20230814_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20230827_file_encryption
import Simplex.Chat.Store.SQLite.Migrations.M20230829_connections_chat_vrange
import Simplex.Chat.Store.SQLite.Migrations.M20230903_connections_to_subscribe
import Simplex.Chat.Store.SQLite.Migrations.M20230913_member_contacts
import Simplex.Chat.Store.SQLite.Migrations.M20230914_member_probes
import Simplex.Chat.Store.SQLite.Migrations.M20230926_contact_status
import Simplex.Chat.Store.SQLite.Migrations.M20231002_conn_initiated
import Simplex.Chat.Store.SQLite.Migrations.M20231009_via_group_link_uri_hash
import Simplex.Chat.Store.SQLite.Migrations.M20231010_member_settings
import Simplex.Chat.Store.SQLite.Migrations.M20231019_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20231030_xgrplinkmem_received
import Simplex.Chat.Store.SQLite.Migrations.M20231107_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20231113_group_forward
import Simplex.Chat.Store.SQLite.Migrations.M20231114_remote_control
import Simplex.Chat.Store.SQLite.Migrations.M20231126_remote_ctrl_address
import Simplex.Chat.Store.SQLite.Migrations.M20231207_chat_list_pagination
import Simplex.Chat.Store.SQLite.Migrations.M20231214_item_content_tag
import Simplex.Chat.Store.SQLite.Migrations.M20231215_recreate_msg_deliveries
import Simplex.Chat.Store.SQLite.Migrations.M20240102_note_folders
import Simplex.Chat.Store.SQLite.Migrations.M20240104_members_profile_update
import Simplex.Chat.Store.SQLite.Migrations.M20240115_block_member_for_all
import Simplex.Chat.Store.SQLite.Migrations.M20240122_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20240214_redirect_file_id
import Simplex.Chat.Store.SQLite.Migrations.M20240222_app_settings
import Simplex.Chat.Store.SQLite.Migrations.M20240226_users_restrict
import Simplex.Chat.Store.SQLite.Migrations.M20240228_pq
import Simplex.Chat.Store.SQLite.Migrations.M20240313_drop_agent_ack_cmd_id
import Simplex.Chat.Store.SQLite.Migrations.M20240324_custom_data
import Simplex.Chat.Store.SQLite.Migrations.M20240402_item_forwarded
import Simplex.Chat.Store.SQLite.Migrations.M20240430_ui_theme
import Simplex.Chat.Store.SQLite.Migrations.M20240501_chat_deleted
import Simplex.Chat.Store.SQLite.Migrations.M20240510_chat_items_via_proxy
import Simplex.Chat.Store.SQLite.Migrations.M20240515_rcv_files_user_approved_relays
import Simplex.Chat.Store.SQLite.Migrations.M20240528_quota_err_counter
import Simplex.Chat.Store.SQLite.Migrations.M20240827_calls_uuid
import Simplex.Chat.Store.SQLite.Migrations.M20240920_user_order
import Simplex.Chat.Store.SQLite.Migrations.M20241008_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20241010_contact_requests_contact_id
import Simplex.Chat.Store.SQLite.Migrations.M20241023_chat_item_autoincrement_id
import Simplex.Chat.Store.SQLite.Migrations.M20241027_server_operators
import Simplex.Chat.Store.SQLite.Migrations.M20241125_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20241128_business_chats
import Simplex.Chat.Store.SQLite.Migrations.M20241205_business_chat_members
import Simplex.Chat.Store.SQLite.Migrations.M20241222_operator_conditions
import Simplex.Chat.Store.SQLite.Migrations.M20241223_chat_tags
import Simplex.Chat.Store.SQLite.Migrations.M20241230_reports
import Simplex.Chat.Store.SQLite.Migrations.M20250105_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20250115_chat_ttl
import Simplex.Chat.Store.SQLite.Migrations.M20250122_chat_items_include_in_history
import Simplex.Chat.Store.SQLite.Migrations.M20250126_mentions
import Simplex.Chat.Store.SQLite.Migrations.M20250129_delete_unused_contacts
import Simplex.Chat.Store.SQLite.Migrations.M20250130_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20250402_short_links
import Simplex.Chat.Store.SQLite.Migrations.M20250512_member_admission
import Simplex.Chat.Store.SQLite.Migrations.M20250513_group_scope
import Simplex.Chat.Store.SQLite.Migrations.M20250526_short_links
import Simplex.Chat.Store.SQLite.Migrations.M20250702_contact_requests_remove_cascade_delete
import Simplex.Chat.Store.SQLite.Migrations.M20250704_groups_conn_link_prepared_connection
import Simplex.Chat.Store.SQLite.Migrations.M20250709_profile_short_descr
import Simplex.Chat.Store.SQLite.Migrations.M20250721_indexes
import Simplex.Chat.Store.SQLite.Migrations.M20250729_member_contact_requests
import Simplex.Chat.Store.SQLite.Migrations.M20250801_via_group_link_uri
import Simplex.Chat.Store.SQLite.Migrations.M20250802_chat_peer_type
import Simplex.Chat.Store.SQLite.Migrations.M20250813_delivery_tasks
import Simplex.Chat.Store.SQLite.Migrations.M20250919_group_summary
import Simplex.Chat.Store.SQLite.Migrations.M20250922_remove_unused_connections
import Simplex.Chat.Store.SQLite.Migrations.M20251007_connections_sync
import Simplex.Chat.Store.SQLite.Migrations.M20251017_chat_tags_cascade
import Simplex.Chat.Store.SQLite.Migrations.M20251117_member_relations_vector
import Simplex.Chat.Store.SQLite.Migrations.M20251128_migrate_member_relations
import Simplex.Messaging.Agent.Store.Shared (Migration (..))
schemaMigrations :: [(String, Query, Maybe Query)]
schemaMigrations :: [(String, Query, Maybe Query)]
schemaMigrations =
[ (String
"20220101_initial", Query
m20220101_initial, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220122_v1_1", Query
m20220122_v1_1, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220205_chat_item_status", Query
m20220205_chat_item_status, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220210_deduplicate_contact_requests", Query
m20220210_deduplicate_contact_requests, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220224_messages_fks", Query
m20220224_messages_fks, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220301_smp_servers", Query
m20220301_smp_servers, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220302_profile_images", Query
m20220302_profile_images, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220304_msg_quotes", Query
m20220304_msg_quotes, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220321_chat_item_edited", Query
m20220321_chat_item_edited, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220404_files_status_fields", Query
m20220404_files_status_fields, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220514_profiles_user_id", Query
m20220514_profiles_user_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220626_auto_reply", Query
m20220626_auto_reply, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220702_calls", Query
m20220702_calls, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220715_groups_chat_item_id", Query
m20220715_groups_chat_item_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220811_chat_items_indices", Query
m20220811_chat_items_indices, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220812_incognito_profiles", Query
m20220812_incognito_profiles, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220818_chat_notifications", Query
m20220818_chat_notifications, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220822_groups_host_conn_custom_user_profile_id", Query
m20220822_groups_host_conn_custom_user_profile_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220823_delete_broken_group_event_chat_items", Query
m20220823_delete_broken_group_event_chat_items, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220824_profiles_local_alias", Query
m20220824_profiles_local_alias, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220909_commands", Query
m20220909_commands, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220926_connection_alias", Query
m20220926_connection_alias, Maybe Query
forall a. Maybe a
Nothing),
(String
"20220928_settings", Query
m20220928_settings, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221001_shared_msg_id_indices", Query
m20221001_shared_msg_id_indices, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221003_delete_broken_integrity_error_chat_items", Query
m20221003_delete_broken_integrity_error_chat_items, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221004_idx_msg_deliveries_message_id", Query
m20221004_idx_msg_deliveries_message_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221011_user_contact_links_group_id", Query
m20221011_user_contact_links_group_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221012_inline_files", Query
m20221012_inline_files, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221019_unread_chat", Query
m20221019_unread_chat, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221021_auto_accept__group_links", Query
m20221021_auto_accept__group_links, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221024_contact_used", Query
m20221024_contact_used, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221025_chat_settings", Query
m20221025_chat_settings, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221029_group_link_id", Query
m20221029_group_link_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221112_server_password", Query
m20221112_server_password, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221115_server_cfg", Query
m20221115_server_cfg, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221129_delete_group_feature_items", Query
m20221129_delete_group_feature_items, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221130_delete_item_deleted", Query
m20221130_delete_item_deleted, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221209_verified_connection", Query
m20221209_verified_connection, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221210_idxs", Query
m20221210_idxs, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221211_group_description", Query
m20221211_group_description, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221212_chat_items_timed", Query
m20221212_chat_items_timed, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221214_live_message", Query
m20221214_live_message, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221222_chat_ts", Query
m20221222_chat_ts, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221223_idx_chat_items_item_status", Query
m20221223_idx_chat_items_item_status, Maybe Query
forall a. Maybe a
Nothing),
(String
"20221230_idxs", Query
m20221230_idxs, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230107_connections_auth_err_counter", Query
m20230107_connections_auth_err_counter, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230111_users_agent_user_id", Query
m20230111_users_agent_user_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230117_fkey_indexes", Query
m20230117_fkey_indexes, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230118_recreate_smp_servers", Query
m20230118_recreate_smp_servers, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230129_drop_chat_items_group_idx", Query
m20230129_drop_chat_items_group_idx, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230206_item_deleted_by_group_member_id", Query
m20230206_item_deleted_by_group_member_id, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230303_group_link_role", Query
m20230303_group_link_role, Maybe Query
forall a. Maybe a
Nothing),
(String
"20230317_hidden_profiles", Query
m20230317_hidden_profiles, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230317_hidden_profiles),
(String
"20230318_file_description", Query
m20230318_file_description, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230318_file_description),
(String
"20230321_agent_file_deleted", Query
m20230321_agent_file_deleted, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230321_agent_file_deleted),
(String
"20230328_files_protocol", Query
m20230328_files_protocol, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230328_files_protocol),
(String
"20230402_protocol_servers", Query
m20230402_protocol_servers, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230402_protocol_servers),
(String
"20230411_extra_xftp_file_descriptions", Query
m20230411_extra_xftp_file_descriptions, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230411_extra_xftp_file_descriptions),
(String
"20230420_rcv_files_to_receive", Query
m20230420_rcv_files_to_receive, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230420_rcv_files_to_receive),
(String
"20230422_profile_contact_links", Query
m20230422_profile_contact_links, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230422_profile_contact_links),
(String
"20230504_recreate_msg_delivery_events_cleanup_messages", Query
m20230504_recreate_msg_delivery_events_cleanup_messages, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230504_recreate_msg_delivery_events_cleanup_messages),
(String
"20230505_chat_item_versions", Query
m20230505_chat_item_versions, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230505_chat_item_versions),
(String
"20230511_reactions", Query
m20230511_reactions, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230511_reactions),
(String
"20230519_item_deleted_ts", Query
m20230519_item_deleted_ts, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230519_item_deleted_ts),
(String
"20230526_indexes", Query
m20230526_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230526_indexes),
(String
"20230529_indexes", Query
m20230529_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230529_indexes),
(String
"20230608_deleted_contacts", Query
m20230608_deleted_contacts, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230608_deleted_contacts),
(String
"20230618_favorite_chats", Query
m20230618_favorite_chats, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230618_favorite_chats),
(String
"20230621_chat_item_moderations", Query
m20230621_chat_item_moderations, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230621_chat_item_moderations),
(String
"20230705_delivery_receipts", Query
m20230705_delivery_receipts, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230705_delivery_receipts),
(String
"20230721_group_snd_item_statuses", Query
m20230721_group_snd_item_statuses, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230721_group_snd_item_statuses),
(String
"20230814_indexes", Query
m20230814_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230814_indexes),
(String
"20230827_file_encryption", Query
m20230827_file_encryption, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230827_file_encryption),
(String
"20230829_connections_chat_vrange", Query
m20230829_connections_chat_vrange, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230829_connections_chat_vrange),
(String
"20230903_connections_to_subscribe", Query
m20230903_connections_to_subscribe, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230903_connections_to_subscribe),
(String
"20230913_member_contacts", Query
m20230913_member_contacts, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230913_member_contacts),
(String
"20230914_member_probes", Query
m20230914_member_probes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230914_member_probes),
(String
"20230926_contact_status", Query
m20230926_contact_status, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20230926_contact_status),
(String
"20231002_conn_initiated", Query
m20231002_conn_initiated, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231002_conn_initiated),
(String
"20231009_via_group_link_uri_hash", Query
m20231009_via_group_link_uri_hash, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231009_via_group_link_uri_hash),
(String
"20231010_member_settings", Query
m20231010_member_settings, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231010_member_settings),
(String
"20231019_indexes", Query
m20231019_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231019_indexes),
(String
"20231030_xgrplinkmem_received", Query
m20231030_xgrplinkmem_received, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231030_xgrplinkmem_received),
(String
"20231107_indexes", Query
m20231107_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231107_indexes),
(String
"20231113_group_forward", Query
m20231113_group_forward, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231113_group_forward),
(String
"20231114_remote_control", Query
m20231114_remote_control, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231114_remote_control),
(String
"20231126_remote_ctrl_address", Query
m20231126_remote_ctrl_address, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231126_remote_ctrl_address),
(String
"20231207_chat_list_pagination", Query
m20231207_chat_list_pagination, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231207_chat_list_pagination),
(String
"20231214_item_content_tag", Query
m20231214_item_content_tag, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231214_item_content_tag),
(String
"20231215_recreate_msg_deliveries", Query
m20231215_recreate_msg_deliveries, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20231215_recreate_msg_deliveries),
(String
"20240102_note_folders", Query
m20240102_note_folders, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240102_note_folders),
(String
"20240104_members_profile_update", Query
m20240104_members_profile_update, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240104_members_profile_update),
(String
"20240115_block_member_for_all", Query
m20240115_block_member_for_all, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240115_block_member_for_all),
(String
"20240122_indexes", Query
m20240122_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240122_indexes),
(String
"20240214_redirect_file_id", Query
m20240214_redirect_file_id, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240214_redirect_file_id),
(String
"20240222_app_settings", Query
m20240222_app_settings, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240222_app_settings),
(String
"20240226_users_restrict", Query
m20240226_users_restrict, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240226_users_restrict),
(String
"20240228_pq", Query
m20240228_pq, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240228_pq),
(String
"20240313_drop_agent_ack_cmd_id", Query
m20240313_drop_agent_ack_cmd_id, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240313_drop_agent_ack_cmd_id),
(String
"20240324_custom_data", Query
m20240324_custom_data, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240324_custom_data),
(String
"20240402_item_forwarded", Query
m20240402_item_forwarded, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240402_item_forwarded),
(String
"20240430_ui_theme", Query
m20240430_ui_theme, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240430_ui_theme),
(String
"20240501_chat_deleted", Query
m20240501_chat_deleted, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240501_chat_deleted),
(String
"20240510_chat_items_via_proxy", Query
m20240510_chat_items_via_proxy, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240510_chat_items_via_proxy),
(String
"20240515_rcv_files_user_approved_relays", Query
m20240515_rcv_files_user_approved_relays, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240515_rcv_files_user_approved_relays),
(String
"20240528_quota_err_counter", Query
m20240528_quota_err_counter, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240528_quota_err_counter),
(String
"20240827_calls_uuid", Query
m20240827_calls_uuid, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240827_calls_uuid),
(String
"20240920_user_order", Query
m20240920_user_order, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20240920_user_order),
(String
"20241008_indexes", Query
m20241008_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241008_indexes),
(String
"20241010_contact_requests_contact_id", Query
m20241010_contact_requests_contact_id, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241010_contact_requests_contact_id),
(String
"20241023_chat_item_autoincrement_id", Query
m20241023_chat_item_autoincrement_id, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241023_chat_item_autoincrement_id),
(String
"20241027_server_operators", Query
m20241027_server_operators, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241027_server_operators),
(String
"20241125_indexes", Query
m20241125_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241125_indexes),
(String
"20241128_business_chats", Query
m20241128_business_chats, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241128_business_chats),
(String
"20241205_business_chat_members", Query
m20241205_business_chat_members, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241205_business_chat_members),
(String
"20241222_operator_conditions", Query
m20241222_operator_conditions, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241222_operator_conditions),
(String
"20241223_chat_tags", Query
m20241223_chat_tags, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241223_chat_tags),
(String
"20241230_reports", Query
m20241230_reports, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20241230_reports),
(String
"20250105_indexes", Query
m20250105_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250105_indexes),
(String
"20250115_chat_ttl", Query
m20250115_chat_ttl, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250115_chat_ttl),
(String
"20250122_chat_items_include_in_history", Query
m20250122_chat_items_include_in_history, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250122_chat_items_include_in_history),
(String
"20250126_mentions", Query
m20250126_mentions, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250126_mentions),
(String
"20250129_delete_unused_contacts", Query
m20250129_delete_unused_contacts, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250129_delete_unused_contacts),
(String
"20250130_indexes", Query
m20250130_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250130_indexes),
(String
"20250402_short_links", Query
m20250402_short_links, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250402_short_links),
(String
"20250512_member_admission", Query
m20250512_member_admission, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250512_member_admission),
(String
"20250513_group_scope", Query
m20250513_group_scope, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250513_group_scope),
(String
"20250526_short_links", Query
m20250526_short_links, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250526_short_links),
(String
"20250702_contact_requests_remove_cascade_delete", Query
m20250702_contact_requests_remove_cascade_delete, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250702_contact_requests_remove_cascade_delete),
(String
"20250704_groups_conn_link_prepared_connection", Query
m20250704_groups_conn_link_prepared_connection, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250704_groups_conn_link_prepared_connection),
(String
"20250709_profile_short_descr", Query
m20250709_profile_short_descr, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250709_profile_short_descr),
(String
"20250721_indexes", Query
m20250721_indexes, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250721_indexes),
(String
"20250729_member_contact_requests", Query
m20250729_member_contact_requests, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250729_member_contact_requests),
(String
"20250801_via_group_link_uri", Query
m20250801_via_group_link_uri, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250801_via_group_link_uri),
(String
"20250802_chat_peer_type", Query
m20250802_chat_peer_type, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250802_chat_peer_type),
(String
"20250813_delivery_tasks", Query
m20250813_delivery_tasks, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250813_delivery_tasks),
(String
"20250919_group_summary", Query
m20250919_group_summary, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250919_group_summary),
(String
"20250922_remove_unused_connections", Query
m20250922_remove_unused_connections, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20250922_remove_unused_connections),
(String
"20251007_connections_sync", Query
m20251007_connections_sync, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20251007_connections_sync),
(String
"20251017_chat_tags_cascade", Query
m20251017_chat_tags_cascade, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20251017_chat_tags_cascade),
(String
"20251117_member_relations_vector", Query
m20251117_member_relations_vector, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20251117_member_relations_vector),
(String
"20251128_migrate_member_relations", Query
m20251128_migrate_member_relations, Query -> Maybe Query
forall a. a -> Maybe a
Just Query
down_m20251128_migrate_member_relations)
]
migrations :: [Migration]
migrations :: [Migration]
migrations = (Migration -> String) -> [Migration] -> [Migration]
forall b a. Ord b => (a -> b) -> [a] -> [a]
sortOn Migration -> String
name ([Migration] -> [Migration]) -> [Migration] -> [Migration]
forall a b. (a -> b) -> a -> b
$ ((String, Query, Maybe Query) -> Migration)
-> [(String, Query, Maybe Query)] -> [Migration]
forall a b. (a -> b) -> [a] -> [b]
map (String, Query, Maybe Query) -> Migration
migration [(String, Query, Maybe Query)]
schemaMigrations
where
migration :: (String, Query, Maybe Query) -> Migration
migration (String
name, Query
up, Maybe Query
down) = Migration {String
name :: String
name :: String
name, up :: Text
up = Query -> Text
fromQuery Query
up, down :: Maybe Text
down = Query -> Text
fromQuery (Query -> Text) -> Maybe Query -> Maybe Text
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Query
down}