1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-29 00:04:52 +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 runMigrations sb migrations = do
dver <- fromMaybe 0 <$> getDbSchemaVersion dver <- fromMaybe 0 <$> getDbSchemaVersion
let aver = length migrations let aver = length migrations
if aver < dver case compare aver dver of
then error "Older app version running with newer DB schema version" LT -> error "Older app version running with newer DB schema version"
else do EQ -> return ()
GT -> do
let migs = drop dver migrations let migs = drop dver migrations
runReaderT (sequence migs) sb runReaderT (sequence migs) sb
setDbSchemaVersion aver setDbSchemaVersion aver