From 6b4ecb99c72b7f8f9116278279fee644a8d43439 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Thu, 1 Sep 2016 17:38:44 +0000 Subject: [PATCH] Migration: Repsert, not update, otherwise schema version never saved --- src/Vervis/Migration.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Vervis/Migration.hs b/src/Vervis/Migration.hs index 8cfe385..574a024 100644 --- a/src/Vervis/Migration.hs +++ b/src/Vervis/Migration.hs @@ -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: