fix(db): prevent superfluous migrations

This commit is contained in:
Steffen Jost 2023-12-11 17:22:41 +01:00
parent 8b93b6a665
commit b73557a1ee
2 changed files with 4 additions and 6 deletions

View File

@ -179,8 +179,7 @@ getMissingMigrations :: forall m m'.
=> ReaderT SqlBackend m (Map ManualMigration (ReaderT SqlBackend m' ()))
getMissingMigrations = do
$logDebugS "Migration" "Retrieve applied migrations"
appliedMigrations <- fmap (map E.unValue) . E.select . E.from $ \appliedMigration -> do
E.where_ $ appliedMigration E.^. AppliedMigrationMigration `E.in_` E.valList universeF
appliedMigrations <- fmap (map E.unValue) . E.select . E.from $ \appliedMigration -> do
return $ appliedMigration E.^. AppliedMigrationMigration
return $ customMigrations `Map.withoutKeys` Set.fromList appliedMigrations

View File

@ -966,10 +966,9 @@ multiSelectField' optMsg mkOpts = Field{..}
fieldParse optlist _ = do
let optlist' = filter notNull optlist
readExternal <- view _olReadExternal <$> liftHandler mkOpts
return . maybe (Left . SomeMessage $ MsgInvalidEntry $ T.intercalate ", " optlist') (Right . Just) $ mapM readExternal optlist'
-- case mapM readExternal optlist' of
-- Nothing -> return $ Left $ SomeMessage $ MsgInvalidEntry $ T.intercalate ", " optlist'
-- res -> return $ Right res
return $ case mapM readExternal optlist' of
Nothing -> Left $ SomeMessage $ MsgInvalidEntry $ T.intercalate ", " optlist'
res -> Right res
fieldView theId name attrs val isReq = do
opts <- liftHandler mkOpts