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 );