1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 15:54:51 +09:00

Don't update DB schema version if equal to app's version

This commit is contained in:
fr33domlover 2016-08-31 17:12:20 +00:00
parent dc74456a6a
commit 7218262223

View file

@ -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