mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 17:13:10 +00:00
core: add protocol field to files table (#2089)
This commit is contained in:
1 parent
f4b349162f
commit
dfec1cbb02
4 files changed
+24
-2
No files matched your search
@@ -0,0 +1,18 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20230328_files_protocol where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20230328_files_protocol :: Query
|
||||
m20230328_files_protocol =
|
||||
[sql|
|
||||
ALTER TABLE files ADD COLUMN protocol TEXT NOT NULL DEFAULT 'smp';
|
||||
|]
|
||||
|
||||
down_m20230328_files_protocol :: Query
|
||||
down_m20230328_files_protocol =
|
||||
[sql|
|
||||
ALTER TABLE files DROP COLUMN protocol;
|
||||
|]
|
||||
@@ -200,7 +200,8 @@ CREATE TABLE files(
|
||||
file_inline TEXT,
|
||||
agent_snd_file_id BLOB NULL,
|
||||
private_snd_file_descr TEXT NULL,
|
||||
agent_snd_file_deleted INTEGER DEFAULT 0 CHECK(agent_snd_file_deleted NOT NULL)
|
||||
agent_snd_file_deleted INTEGER DEFAULT 0 CHECK(agent_snd_file_deleted NOT NULL),
|
||||
protocol TEXT NOT NULL DEFAULT 'smp'
|
||||
);
|
||||
CREATE TABLE snd_files(
|
||||
file_id INTEGER NOT NULL REFERENCES files ON DELETE CASCADE,
|
||||
|
||||
Reference in new issue
Block a user