mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:34:51 +09:00
Migration: Repsert, not update, otherwise schema version never saved
This commit is contained in:
parent
cd1f7af46e
commit
6b4ecb99c7
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ getDbSchemaVersion :: MonadIO m => ReaderT SqlBackend m (Maybe Int)
|
||||||
getDbSchemaVersion = fmap schemaVersionNumber <$> get key
|
getDbSchemaVersion = fmap schemaVersionNumber <$> get key
|
||||||
|
|
||||||
setDbSchemaVersion :: MonadIO m => Int -> ReaderT SqlBackend m ()
|
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
|
-- | Run the migration system. The second parameter is the list of migration
|
||||||
-- actions in chronological order. The migration process is:
|
-- actions in chronological order. The migration process is:
|
||||||
|
|
Loading…
Reference in a new issue