From 46cb13e5b05a0b3ecd5222d7a48cb4a43b59f40e Mon Sep 17 00:00:00 2001 From: Pere Lev Date: Tue, 14 May 2024 23:14:12 +0300 Subject: [PATCH] DB: Add tables for tracking project extending delegations to teams --- .../639_2024-05-14_component_convey.model | 24 ++++++++++++++ src/Vervis/Migration.hs | 2 ++ src/Vervis/Migration/Entities.hs | 4 +++ th/models | 32 ++++++++++++++++++- 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 migrations/639_2024-05-14_component_convey.model diff --git a/migrations/639_2024-05-14_component_convey.model b/migrations/639_2024-05-14_component_convey.model new file mode 100644 index 0000000..518ae7d --- /dev/null +++ b/migrations/639_2024-05-14_component_convey.model @@ -0,0 +1,24 @@ +ComponentConvey + component ComponentEnableId + team SquadUsStartId + grant OutboxItemId + + UniqueComponentConvey component team + UniqueComponentConveyGrant grant + +SourceUsConvey + source SourceUsSendDelegatorId + team SquadUsStartId + grant OutboxItemId + +SourceUsConveyFromLocal + convey SourceUsConveyId + from SourceThemDelegateLocalId + + UniqueSourceUsConveyFromLocal convey + +SourceUsConveyFromRemote + convey SourceUsConveyId + from SourceThemDelegateRemoteId + + UniqueSourceUsConveyFromRemote convey diff --git a/src/Vervis/Migration.hs b/src/Vervis/Migration.hs index ccd8165..aeb2ef7 100644 --- a/src/Vervis/Migration.hs +++ b/src/Vervis/Migration.hs @@ -3811,6 +3811,8 @@ changes hLocal ctx = , removeEntity "StemIdentLoom" -- 638 , addEntities model_638_effort_squad + -- 639 + , addEntities model_639_component_convey ] migrateDB diff --git a/src/Vervis/Migration/Entities.hs b/src/Vervis/Migration/Entities.hs index e3658d1..f88f68c 100644 --- a/src/Vervis/Migration/Entities.hs +++ b/src/Vervis/Migration/Entities.hs @@ -77,6 +77,7 @@ module Vervis.Migration.Entities , model_603_resource , model_626_komponent , model_638_effort_squad + , model_639_component_convey ) where @@ -301,3 +302,6 @@ model_626_komponent = $(schema "626_2024-04-29_komponent") model_638_effort_squad :: [Entity SqlBackend] model_638_effort_squad = $(schema "638_2024-05-14_effort_squad") + +model_639_component_convey :: [Entity SqlBackend] +model_639_component_convey = $(schema "639_2024-05-14_component_convey") diff --git a/th/models b/th/models index 2e81062..cde58f1 100644 --- a/th/models +++ b/th/models @@ -1073,6 +1073,16 @@ ComponentGather UniqueComponentGather component parent UniqueComponentGatherGrant grant +-- Witnesses that the project has extended the delegation to a given team + +ComponentConvey + component ComponentEnableId + team SquadUsStartId + grant OutboxItemId + + UniqueComponentConvey component team + UniqueComponentConveyGrant grant + ------------------------------------------------------------------------------ -- Components, from component perspective ------------------------------------------------------------------------------ @@ -1432,6 +1442,26 @@ SourceUsLeafToRemote UniqueSourceUsLeafToRemote leaf +-- Witnesses that, seeing the delegation from them, I've sent an +-- extension-Grant to a team-collaborator of mine + +SourceUsConvey + source SourceUsSendDelegatorId + team SquadUsStartId + grant OutboxItemId + +SourceUsConveyFromLocal + convey SourceUsConveyId + from SourceThemDelegateLocalId + + UniqueSourceUsConveyFromLocal convey + +SourceUsConveyFromRemote + convey SourceUsConveyId + from SourceThemDelegateRemoteId + + UniqueSourceUsConveyFromRemote convey + -------------------------------- Source remove ------------------------------- -- Witnesses there's a removal request from the child's side, and I'm waiting @@ -1971,7 +2001,7 @@ SquadThemSendDelegatorRemote UniqueSquadThemSendDelegatorRemoteTopic topic UniqueSquadThemSendDelegatorRemoteGrant grant --- Witnesses that, seeing the delegator-Grant, I've sent my new parent a +-- Witnesses that, seeing the delegator-Grant, I've sent my new team a -- start-Grant to delegate further SquadUsStart