move servers update before migration (so it re-tries in case of crash)

This commit is contained in:
Evgeny Poberezkin
2022-08-18 08:39:22 +01:00
parent b2d4bfd0a8
commit 3fc9afbb35
@@ -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