1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 16:04:52 +09:00

Migration: Repsert, not update, otherwise schema version never saved

This commit is contained in:
fr33domlover 2016-09-01 17:38:44 +00:00
parent cd1f7af46e
commit 6b4ecb99c7

View file

@ -38,7 +38,7 @@ getDbSchemaVersion :: MonadIO m => ReaderT SqlBackend m (Maybe Int)
getDbSchemaVersion = fmap schemaVersionNumber <$> get key
setDbSchemaVersion :: MonadIO m => Int -> ReaderT SqlBackend m ()
setDbSchemaVersion v = update key [SchemaVersionNumber =. v]
setDbSchemaVersion v = repsert key $ SchemaVersion v
-- | Run the migration system. The second parameter is the list of migration
-- actions in chronological order. The migration process is: