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:
parent
dc74456a6a
commit
7218262223
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue