diff --git a/src/Simplex/Chat/Store/SQLite/Migrations/M20251016_chat_relays.hs b/src/Simplex/Chat/Store/SQLite/Migrations/M20251016_chat_relays.hs index b3287320d9..cb81f2ef5a 100644 --- a/src/Simplex/Chat/Store/SQLite/Migrations/M20251016_chat_relays.hs +++ b/src/Simplex/Chat/Store/SQLite/Migrations/M20251016_chat_relays.hs @@ -28,11 +28,28 @@ CREATE INDEX idx_chat_relays_user_id ON chat_relays(user_id); ALTER TABLE users ADD COLUMN is_user_chat_relay INTEGER NOT NULL DEFAULT 0; ALTER TABLE group_members ADD COLUMN is_chat_relay INTEGER NOT NULL DEFAULT 0; + +-- Relay's link for group +ALTER TABLE groups ADD COLUMN relay_link BLOB; + +-- Owner's list of relays for group +-- TBC relay_status: invited/accepted/added/notified/confirmed +-- relay_link: links for all relays are included in GroupShortLinkData +CREATE TABLE group_relays( + group_relay_id INTEGER PRIMARY KEY, + group_id INTEGER NOT NULL REFERENCES groups ON DELETE CASCADE, + relay_status TEXT NOT NULL, + relay_link BLOB +); |] down_m20251016_chat_relays :: Query down_m20251016_chat_relays = [sql| +DROP TABLE group_relays; + +ALTER TABLE groups DROP COLUMN relay_link; + ALTER TABLE group_members DROP COLUMN is_chat_relay; ALTER TABLE users DROP COLUMN is_user_chat_relay;