diff --git a/src/Vervis/Migration.hs b/src/Vervis/Migration.hs index c341b9e..8cfe385 100644 --- a/src/Vervis/Migration.hs +++ b/src/Vervis/Migration.hs @@ -55,9 +55,10 @@ runMigrations runMigrations sb migrations = do dver <- fromMaybe 0 <$> getDbSchemaVersion let aver = length migrations - if aver < dver - then error "Older app version running with newer DB schema version" - else do + case compare aver dver of + LT -> error "Older app version running with newer DB schema version" + EQ -> return () + GT -> do let migs = drop dver migrations runReaderT (sequence migs) sb setDbSchemaVersion aver