mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-15 02:21:08 +00:00
Merge branch 'master' into badges
This commit is contained in:
@@ -46,6 +46,8 @@ import Simplex.Chat.Store.Postgres.Migrations.M20260715_profile_description
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20260716_signed_history
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20260720_server_roles
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20260723_contact_request_rejection
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20260813_auto_accept_group_invitations
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20260822_forward_link
|
||||
import Simplex.Messaging.Agent.Store.Shared (Migration (..))
|
||||
|
||||
schemaMigrations :: [(String, Text, Maybe Text)]
|
||||
@@ -91,7 +93,9 @@ schemaMigrations =
|
||||
("20260715_profile_description", m20260715_profile_description, Just down_m20260715_profile_description),
|
||||
("20260716_signed_history", m20260716_signed_history, Just down_m20260716_signed_history),
|
||||
("20260720_server_roles", m20260720_server_roles, Just down_m20260720_server_roles),
|
||||
("20260723_contact_request_rejection", m20260723_contact_request_rejection, Just down_m20260723_contact_request_rejection)
|
||||
("20260723_contact_request_rejection", m20260723_contact_request_rejection, Just down_m20260723_contact_request_rejection),
|
||||
("20260813_auto_accept_group_invitations", m20260813_auto_accept_group_invitations, Just down_m20260813_auto_accept_group_invitations),
|
||||
("20260822_forward_link", m20260822_forward_link, Just down_m20260822_forward_link)
|
||||
]
|
||||
|
||||
-- | The list of migrations in ascending order by date
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20260813_auto_accept_group_invitations where
|
||||
|
||||
import Data.Text (Text)
|
||||
import Text.RawString.QQ (r)
|
||||
|
||||
m20260813_auto_accept_group_invitations :: Text
|
||||
m20260813_auto_accept_group_invitations =
|
||||
[r|
|
||||
ALTER TABLE users ADD COLUMN auto_accept_group_invitations SMALLINT NOT NULL DEFAULT 0;
|
||||
|]
|
||||
|
||||
down_m20260813_auto_accept_group_invitations :: Text
|
||||
down_m20260813_auto_accept_group_invitations =
|
||||
[r|
|
||||
ALTER TABLE users DROP COLUMN auto_accept_group_invitations;
|
||||
|]
|
||||
@@ -0,0 +1,27 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20260822_forward_link where
|
||||
|
||||
import Data.Text (Text)
|
||||
import Text.RawString.QQ (r)
|
||||
|
||||
m20260822_forward_link :: Text
|
||||
m20260822_forward_link =
|
||||
[r|
|
||||
ALTER TABLE chat_items ADD COLUMN fwd_from_group_type TEXT;
|
||||
ALTER TABLE chat_items ADD COLUMN fwd_from_group_link BYTEA;
|
||||
ALTER TABLE chat_items ADD COLUMN fwd_from_public_group_id BYTEA;
|
||||
ALTER TABLE chat_items ADD COLUMN fwd_from_member_id BYTEA;
|
||||
ALTER TABLE chat_items ADD COLUMN fwd_from_shared_msg_id BYTEA;
|
||||
|]
|
||||
|
||||
down_m20260822_forward_link :: Text
|
||||
down_m20260822_forward_link =
|
||||
[r|
|
||||
ALTER TABLE chat_items DROP COLUMN fwd_from_group_type;
|
||||
ALTER TABLE chat_items DROP COLUMN fwd_from_group_link;
|
||||
ALTER TABLE chat_items DROP COLUMN fwd_from_public_group_id;
|
||||
ALTER TABLE chat_items DROP COLUMN fwd_from_member_id;
|
||||
ALTER TABLE chat_items DROP COLUMN fwd_from_shared_msg_id;
|
||||
|]
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20260731_user_badges where
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20261001_user_badges where
|
||||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
@@ -192,8 +192,8 @@ DROP TABLE @badge_offers;
|
||||
DROP TABLE @badge_prices;
|
||||
|]
|
||||
|
||||
m20260731_user_badges :: Text
|
||||
m20260731_user_badges =
|
||||
m20261001_user_badges :: Text
|
||||
m20261001_user_badges =
|
||||
badgeSchema ""
|
||||
<> [r|
|
||||
ALTER TABLE badge_purchases ADD COLUMN user_id BIGINT REFERENCES users ON DELETE CASCADE;
|
||||
@@ -219,8 +219,8 @@ CREATE INDEX idx_badge_purchases_user ON badge_purchases(user_id);
|
||||
ALTER TABLE users ADD COLUMN shown_badge_id BIGINT REFERENCES badge_purchases ON DELETE SET NULL;
|
||||
|]
|
||||
|
||||
down_m20260731_user_badges :: Text
|
||||
down_m20260731_user_badges =
|
||||
down_m20261001_user_badges :: Text
|
||||
down_m20261001_user_badges =
|
||||
[r|
|
||||
ALTER TABLE users DROP COLUMN shown_badge_id;
|
||||
|]
|
||||
@@ -349,7 +349,12 @@ CREATE TABLE test_chat_schema.chat_items (
|
||||
item_msg_body bytea,
|
||||
item_chat_binding text,
|
||||
item_signatures bytea,
|
||||
item_signed_by_group_member_id bigint
|
||||
item_signed_by_group_member_id bigint,
|
||||
fwd_from_group_type text,
|
||||
fwd_from_group_link bytea,
|
||||
fwd_from_public_group_id bytea,
|
||||
fwd_from_member_id bytea,
|
||||
fwd_from_shared_msg_id bytea
|
||||
);
|
||||
|
||||
|
||||
@@ -1510,7 +1515,8 @@ CREATE TABLE test_chat_schema.users (
|
||||
active_order bigint DEFAULT 0 NOT NULL,
|
||||
auto_accept_member_contacts smallint DEFAULT 0 NOT NULL,
|
||||
is_user_chat_relay smallint DEFAULT 0 NOT NULL,
|
||||
client_service smallint DEFAULT 0 NOT NULL
|
||||
client_service smallint DEFAULT 0 NOT NULL,
|
||||
auto_accept_group_invitations smallint DEFAULT 0 NOT NULL
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user