From 1e15d56e92c0549c7ba6a60d2c9d557b2949b0ff Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 23 Dec 2023 16:06:11 +0000 Subject: [PATCH] 5.5.0.1: fix migration --- .../Store/SQLite/Migrations/M20231222_command_created_at.hs | 2 +- .../Messaging/Agent/Store/SQLite/Migrations/agent_schema.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20231222_command_created_at.hs b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20231222_command_created_at.hs index 7cc0e25ea..08fab61b3 100644 --- a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20231222_command_created_at.hs +++ b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20231222_command_created_at.hs @@ -8,7 +8,7 @@ import Database.SQLite.Simple.QQ (sql) m20231222_command_created_at :: Query m20231222_command_created_at = [sql| -ALTER TABLE commands ADD COLUMN created_at TEXT NOT NULL DEFAULT(datetime('now')); +ALTER TABLE commands ADD COLUMN created_at TEXT NOT NULL DEFAULT('1970-01-01 00:00:00'); CREATE INDEX idx_commands_server_commands ON commands(host, port, created_at, command_id); |] diff --git a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/agent_schema.sql b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/agent_schema.sql index 1b976b620..d917f0324 100644 --- a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/agent_schema.sql +++ b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/agent_schema.sql @@ -229,7 +229,7 @@ CREATE TABLE commands( command BLOB NOT NULL, agent_version INTEGER NOT NULL DEFAULT 1, server_key_hash BLOB, - created_at TEXT NOT NULL DEFAULT(datetime('now')), + created_at TEXT NOT NULL DEFAULT('1970-01-01 00:00:00'), FOREIGN KEY(host, port) REFERENCES servers ON DELETE RESTRICT ON UPDATE CASCADE );