mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-28 15:38:56 +00:00
Merge branch 'master' into chat-relays
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20251230_strict_tables where
|
||||
|
||||
import Data.Text (Text)
|
||||
import Text.RawString.QQ (r)
|
||||
import Simplex.Messaging.Agent.Store.Postgres.Migrations.M20251230_strict_tables (isValidText)
|
||||
|
||||
m20251230_strict_tables :: Text
|
||||
m20251230_strict_tables =
|
||||
isValidText
|
||||
<> [r|
|
||||
DELETE FROM calls
|
||||
WHERE NOT simplex_is_valid_text(call_state);
|
||||
|
||||
ALTER TABLE calls ALTER COLUMN call_state TYPE TEXT USING call_state::TEXT;
|
||||
|
||||
DROP FUNCTION simplex_is_valid_text(BYTEA);
|
||||
|]
|
||||
|
||||
down_m20251230_strict_tables :: Text
|
||||
down_m20251230_strict_tables =
|
||||
[r|
|
||||
ALTER TABLE calls ALTER COLUMN call_state TYPE BYTEA USING call_state::BYTEA;
|
||||
|]
|
||||
@@ -173,7 +173,7 @@ CREATE TABLE test_chat_schema.calls (
|
||||
contact_id bigint NOT NULL,
|
||||
shared_call_id bytea NOT NULL,
|
||||
chat_item_id bigint NOT NULL,
|
||||
call_state bytea NOT NULL,
|
||||
call_state text NOT NULL,
|
||||
call_ts timestamp with time zone NOT NULL,
|
||||
user_id bigint NOT NULL,
|
||||
created_at timestamp with time zone DEFAULT now() NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user