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: