mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-02-02 22:30:24 +01:00
Add ability to skip migrations
This commit is contained in:
parent
66bd8eb752
commit
5b9cb8ba14
@ -216,15 +216,18 @@ makeFoundation useEcho conf = do
|
|||||||
, websiteContent = websiteContent'
|
, websiteContent = websiteContent'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env <- getEnvironment
|
||||||
|
|
||||||
-- Perform database migration using our application's logging settings.
|
-- Perform database migration using our application's logging settings.
|
||||||
runResourceT $
|
when (lookup "STACKAGE_SKIP_MIGRATION" env /= Just "1") $
|
||||||
|
runResourceT $
|
||||||
flip runReaderT gen $
|
flip runReaderT gen $
|
||||||
flip runLoggingT (messageLoggerSource foundation logger) $
|
flip runLoggingT (messageLoggerSource foundation logger) $
|
||||||
flip (Database.Persist.runPool dbconf) p $ do
|
flip (Database.Persist.runPool dbconf) p $ do
|
||||||
runMigration migrateAll
|
runMigration migrateAll
|
||||||
checkMigration 1 $ fixSnapSlugs
|
checkMigration 1 $ fixSnapSlugs
|
||||||
|
|
||||||
env <- getEnvironment
|
|
||||||
let updateDB = lookup "STACKAGE_CABAL_LOADER" env /= Just "0"
|
let updateDB = lookup "STACKAGE_CABAL_LOADER" env /= Just "0"
|
||||||
forceUpdate = lookup "STACKAGE_FORCE_UPDATE" env == Just "1"
|
forceUpdate = lookup "STACKAGE_FORCE_UPDATE" env == Just "1"
|
||||||
loadCabalFiles' = appLoadCabalFiles updateDB forceUpdate foundation dbconf p
|
loadCabalFiles' = appLoadCabalFiles updateDB forceUpdate foundation dbconf p
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user