mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-20 14:57:41 +03:00
Vacuum once after all migrations have been completed. (#2972)
This commit is contained in:
parent
34791ed870
commit
d70168f2b1
@ -52,6 +52,9 @@ ensureCodebaseIsUpToDate localOrRemote root conn codebase = UnliftIO.try do
|
||||
liftIO . putStrLn $ "🔨 Migrating codebase to version " <> show v <> "..."
|
||||
migration conn codebase
|
||||
when ((not . null) migrationsToRun) $ do
|
||||
-- Vacuum once now that any migrations have taken place.
|
||||
liftIO $ putStrLn $ "Cleaning up..."
|
||||
liftIO . flip runReaderT conn $ Q.vacuum
|
||||
liftIO . putStrLn $ "🏁 Migration complete. 🏁"
|
||||
|
||||
-- | Copy the sqlite database to a new file with a unique name based on current time.
|
||||
|
@ -149,8 +149,6 @@ migrateSchema1To2 conn codebase = do
|
||||
runDB conn (liftQ Q.garbageCollectWatchesWithoutObjects)
|
||||
liftIO $ putStrLn $ "Updating Schema Version..."
|
||||
runDB conn . liftQ $ Q.setSchemaVersion 2
|
||||
liftIO $ putStrLn $ "Cleaning up..."
|
||||
runDB conn (liftQ Q.vacuum)
|
||||
pure $ Right ()
|
||||
where
|
||||
withinSavepoint :: (String -> m c -> m c)
|
||||
|
Loading…
Reference in New Issue
Block a user