From 3fc9afbb351033413dd84344ec603910e370a8ec Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:39:22 +0100 Subject: [PATCH] move servers update before migration (so it re-tries in case of crash) --- src/Simplex/Messaging/Agent/Store/SQLite/Migrations.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations.hs b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations.hs index 2f5491674..ceccaa0f0 100644 --- a/src/Simplex/Messaging/Agent/Store/SQLite/Migrations.hs +++ b/src/Simplex/Messaging/Agent/Store/SQLite/Migrations.hs @@ -64,8 +64,8 @@ get conn migrations = run :: Connection -> [Migration] -> IO () run conn ms = forM_ ms $ \Migration {name, up} -> do - DB.withImmediateTransaction conn $ insert name >> execSQL up when (name == "m20220811_onion_hosts") updateServers + DB.withImmediateTransaction conn $ insert name >> execSQL up where insert name = DB.execute conn "INSERT INTO migrations (name, ts) VALUES (?, ?);" . (name,) =<< getCurrentTime execSQL = SQLite3.exec $ DB.connectionHandle conn