refactor: hlint
This commit is contained in:
parent
f1ba4659ac
commit
3f5b5727e3
@ -193,15 +193,13 @@ migrateAlwaysSafe = do
|
||||
let missingChangelogItems = Set.toList $ Set.fromList universeF `Set.difference` recordedChangelogItems'
|
||||
where recordedChangelogItems' = Set.fromList [ changelogItemFirstSeenItem | Entity _ ChangelogItemFirstSeen{..} <- recordedChangelogItems ]
|
||||
unless (null missingChangelogItems) $ do
|
||||
now <- iso8601Show . localDay . TZ.utcToLocalTimeTZ appTZ <$> liftIO getCurrentTime
|
||||
today <- localDay . TZ.utcToLocalTimeTZ appTZ <$> liftIO getCurrentTime
|
||||
addMigration False $ do
|
||||
let sql = [st|INSERT INTO changelog_item_first_seen (item, first_seen) VALUES #{vals}|]
|
||||
vals = Text.intercalate ", " $ do
|
||||
item <- missingChangelogItems
|
||||
let itemDay = case Map.lookup item changelogItemDays of
|
||||
Just d -> iso8601Show d
|
||||
Nothing -> now
|
||||
return [st|('#{toPathPiece item}', '#{itemDay}')|]
|
||||
let itemDay = Map.findWithDefault today item changelogItemDays
|
||||
return [st|('#{toPathPiece item}', '#{iso8601Show itemDay}')|]
|
||||
in sql
|
||||
|
||||
{-
|
||||
|
||||
Loading…
Reference in New Issue
Block a user