1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 18:14:52 +09:00

Remove Discussion's nextMessage field, it's not being used anymore

This commit is contained in:
fr33domlover 2019-03-18 20:18:25 +00:00
parent 4b351ef62e
commit e0de4cdcc7
4 changed files with 8 additions and 8 deletions

View file

@ -218,7 +218,6 @@ TicketClaimRequest
UniqueTicketClaimRequest person ticket
Discussion
nextMessage Int
Message
author PersonId

View file

@ -133,10 +133,7 @@ postTicketsR shar proj = do
now <- liftIO getCurrentTime
tnum <- runDB $ do
update pid [ProjectNextTicket +=. 1]
let discussion = Discussion
{ discussionNextMessage = 1
}
did <- insert discussion
did <- insert Discussion
let ticket = Ticket
{ ticketProject = pid
, ticketNumber = projectNextTicket project

View file

@ -197,6 +197,8 @@ changes =
, removeUnique "Message" "UniqueMessage"
-- 44
, removeField "Message" "number"
-- 45
, removeField "Discussion" "nextMessage"
]
migrateDB :: MonadIO m => ReaderT SqlBackend m (Either Text (Int, Int))

View file

@ -1,6 +1,6 @@
{- This file is part of Vervis.
-
- Written in 2016, 2018 by fr33domlover <fr33domlover@riseup.net>.
- Written in 2016, 2018, 2019 by fr33domlover <fr33domlover@riseup.net>.
-
- Copying is an act of love. Please copy, reuse and share.
-
@ -58,11 +58,13 @@ getTicketSummaries mfilt morder jid = do
, tsComments = r
}
fmap (map toSummary) $ select $ from $
\ (t `InnerJoin` p `InnerJoin` s `InnerJoin` d) -> do
\ (t `InnerJoin` p `InnerJoin` s `InnerJoin` d `LeftOuterJoin` m) -> do
on $ just (d ^. DiscussionId) ==. m ?. MessageRoot
on $ t ^. TicketDiscuss ==. d ^. DiscussionId
on $ p ^. PersonIdent ==. s ^. SharerId
on $ t ^. TicketCreator ==. p ^. PersonId
where_ $ t ^. TicketProject ==. val jid
groupBy $ d ^. DiscussionId
for_ mfilt $ \ filt -> where_ $ filt t
for_ morder $ \ order -> orderBy $ order t
return
@ -71,7 +73,7 @@ getTicketSummaries mfilt morder jid = do
, t ^. TicketCreated
, t ^. TicketTitle
, t ^. TicketStatus
, d ^. DiscussionNextMessage -. val 1
, count $ m ?. MessageId
)
-- | Get the child-parent ticket number pairs of all the ticket dependencies