1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 17:24:53 +09:00

DB: In TAL and TAR, rename 'offer' to 'open'

That's because with the Create flow added, the activity that reports a ticket
can be either Create or Offer, maybe later Announce too.

The old TAL unique name mentioned in the migration has what may look like a
typo, "Locale" instead of "Local". That's because I made a typo in migration
115, and now needed to specify the typoed name I used then. I verified in dev
DB and on dev.angeley.es DB that the typo is reflected in the PostgreSQL
database side and fixed by the new migrations.
This commit is contained in:
fr33domlover 2020-02-08 09:35:35 +00:00
parent 6fa0a9cb46
commit fb9e2dd4dd
5 changed files with 23 additions and 9 deletions

View file

@ -375,18 +375,18 @@ TicketProjectLocal
TicketAuthorLocal
ticket LocalTicketId
author PersonId
offer OutboxItemId
open OutboxItemId
UniqueTicketAuthorLocal ticket
UniqueTicketAuthorLocalOffer offer
UniqueTicketAuthorLocalOpen open
TicketAuthorRemote
ticket TicketProjectLocalId
author RemoteActorId
offer RemoteActivityId
open RemoteActivityId
UniqueTicketAuthorRemote ticket
UniqueTicketAuthorRemoteOffer offer
UniqueTicketAuthorRemoteOpen open
TicketDependency
parent TicketId

View file

@ -877,7 +877,7 @@ offerTicketC shrUser summary audience offer@(Offer ticket uTarget) = runExceptT
insert_ TicketAuthorLocal
{ ticketAuthorLocalTicket = ltid
, ticketAuthorLocalAuthor = pidAuthor
, ticketAuthorLocalOffer = obiid
, ticketAuthorLocalOpen = obiid
}
--insertMany_ $ map (TicketDependency tid) tidsDeps
-- insert_ $ Follow pidAuthor fsid False True

View file

@ -286,7 +286,7 @@ projectOfferTicketF
insert_ TicketAuthorRemote
{ ticketAuthorRemoteTicket = tplid
, ticketAuthorRemoteAuthor = raidAuthor
, ticketAuthorRemoteOffer = ractid
, ticketAuthorRemoteOpen = ractid
}
docAccept <- insertAccept ra luOffer ltid obiidAccept
-- insertMany_ $ map (TicketDependency tid) deps

View file

@ -694,7 +694,7 @@ postTicketsR shr prj = do
ExceptT $ offerTicket shrAuthor (TextHtml title) (TextPandocMarkdown desc) shr prj
obiid <- ExceptT $ offerTicketC shrAuthor summary audience offer
ExceptT $ runDB $ do
mtal <- getValBy $ UniqueTicketAuthorLocalOffer obiid
mtal <- getValBy $ UniqueTicketAuthorLocalOpen obiid
return $
case mtal of
Nothing ->

View file

@ -1407,6 +1407,20 @@ changes hLocal ctx =
"UniqueTicketAuthorRemote"
-- 210
, renameField "TicketAuthorRemote" "ticketNew" "ticket"
-- 211
, renameField "TicketAuthorLocal" "offer" "open"
-- 212
, renameUnique
"TicketAuthorLocal"
"UniqueTicketAuthorLocaleOffer"
"UniqueTicketAuthorLocalOpen"
-- 213
, renameField "TicketAuthorRemote" "offer" "open"
-- 214
, renameUnique
"TicketAuthorRemote"
"UniqueTicketAuthorRemoteOffer"
"UniqueTicketAuthorRemoteOpen"
]
migrateDB