mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
core, ios: advanced server config (#1371)
* ios: advanced server config * simplify UI * core: ServerCfg * commit migration, update schema * add preset servers to response * return default servers if none saved * fix test
This commit is contained in:
committed by
GitHub
parent
f8302e2030
commit
491fe4a9bf
@@ -0,0 +1,19 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20221115_server_cfg where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20221115_server_cfg :: Query
|
||||
m20221115_server_cfg =
|
||||
[sql|
|
||||
PRAGMA ignore_check_constraints=ON;
|
||||
|
||||
ALTER TABLE smp_servers ADD COLUMN preset INTEGER DEFAULT 0 CHECK (preset NOT NULL);
|
||||
ALTER TABLE smp_servers ADD COLUMN tested INTEGER;
|
||||
ALTER TABLE smp_servers ADD COLUMN enabled INTEGER DEFAULT 1 CHECK (enabled NOT NULL);
|
||||
UPDATE smp_servers SET preset = 0, enabled = 1;
|
||||
|
||||
PRAGMA ignore_check_constraints=OFF;
|
||||
|]
|
||||
@@ -385,6 +385,9 @@ CREATE TABLE smp_servers(
|
||||
created_at TEXT NOT NULL DEFAULT(datetime('now')),
|
||||
updated_at TEXT NOT NULL DEFAULT(datetime('now')),
|
||||
basic_auth TEXT,
|
||||
preset INTEGER DEFAULT 0 CHECK(preset NOT NULL),
|
||||
tested INTEGER,
|
||||
enabled INTEGER DEFAULT 1 CHECK(enabled NOT NULL),
|
||||
UNIQUE(host, port)
|
||||
);
|
||||
CREATE INDEX idx_messages_shared_msg_id ON messages(shared_msg_id);
|
||||
|
||||
Reference in New Issue
Block a user