DB: Add a Komponent record, to gather local repos/decks/looms/etc.
This commit is contained in:
parent
1d08e43175
commit
aeb1a83c93
9 changed files with 203 additions and 19 deletions
4
migrations/626_2024-04-29_komponent.model
Normal file
4
migrations/626_2024-04-29_komponent.model
Normal file
|
@ -0,0 +1,4 @@
|
|||
Komponent
|
||||
resource ResourceId
|
||||
|
||||
UniqueKomponent resource
|
69
migrations/627_2024-04-29_komponent_mig.model
Normal file
69
migrations/627_2024-04-29_komponent_mig.model
Normal file
|
@ -0,0 +1,69 @@
|
|||
Workflow
|
||||
OutboxItem
|
||||
|
||||
Outbox
|
||||
|
||||
Inbox
|
||||
|
||||
FollowerSet
|
||||
|
||||
Actor
|
||||
name Text
|
||||
desc Text
|
||||
createdAt UTCTime
|
||||
inbox InboxId
|
||||
outbox OutboxId
|
||||
followers FollowerSetId
|
||||
justCreatedBy ActorId Maybe
|
||||
errbox InboxId
|
||||
|
||||
UniqueActorInbox inbox
|
||||
UniqueActorOutbox outbox
|
||||
UniqueActorFollowers followers
|
||||
|
||||
Resource
|
||||
actor ActorId
|
||||
|
||||
UniqueResource actor
|
||||
|
||||
Komponent
|
||||
resource ResourceId
|
||||
|
||||
UniqueKomponent resource
|
||||
|
||||
Deck
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
workflow WorkflowId
|
||||
nextTicket Int
|
||||
wiki RepoId Maybe
|
||||
create OutboxItemId
|
||||
|
||||
UniqueDeckActor actor
|
||||
UniqueDeckCreate create
|
||||
|
||||
Loom
|
||||
nextTicket Int
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
repo RepoId
|
||||
create OutboxItemId
|
||||
|
||||
UniqueLoomActor actor
|
||||
UniqueLoomRepo repo
|
||||
UniqueLoomCreate create
|
||||
|
||||
Repo
|
||||
vcs VersionControlSystem
|
||||
project DeckId Maybe
|
||||
mainBranch Text
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
create OutboxItemId
|
||||
loom LoomId Maybe
|
||||
|
||||
UniqueRepoActor actor
|
||||
UniqueRepoCreate create
|
|
@ -1132,10 +1132,12 @@ createPatchTrackerC (Entity pidUser personUser) senderActor maybeCap localRecips
|
|||
actor@(Entity actorID _) <-
|
||||
insertActor now name (fromMaybe "" msummary) (Just $ personActor personUser)
|
||||
resourceID <- insert $ Resource actorID
|
||||
komponentID <- insert $ Komponent resourceID
|
||||
loomID <- insert Loom
|
||||
{ loomNextTicket = 1
|
||||
, loomActor = actorID
|
||||
, loomResource = resourceID
|
||||
, loomKomponent = komponentID
|
||||
, loomRepo = repoID
|
||||
, loomCreate = obiidCreate
|
||||
}
|
||||
|
@ -1369,12 +1371,14 @@ createRepositoryC (Entity pidUser personUser) senderActor maybeCap localRecips r
|
|||
actor@(Entity actorID _) <-
|
||||
insertActor now name (fromMaybe "" msummary) (Just $ personActor personUser)
|
||||
resourceID <- insert $ Resource actorID
|
||||
komponentID <- insert $ Komponent resourceID
|
||||
repoID <- insert Repo
|
||||
{ repoVcs = vcs
|
||||
, repoProject = Nothing
|
||||
, repoMainBranch = "main"
|
||||
, repoActor = actorID
|
||||
, repoResource = resourceID
|
||||
, repoKomponent = komponentID
|
||||
, repoCreate = createID
|
||||
, repoLoom = Nothing
|
||||
}
|
||||
|
|
|
@ -79,13 +79,14 @@ import Vervis.Web.Collab
|
|||
|
||||
-- Meaning: An actor is adding some object to some target
|
||||
-- Behavior:
|
||||
-- * If the object is me:
|
||||
-- * Verify that the object is me
|
||||
-- * Verify the target is some project's components collection URI
|
||||
-- * Verify the Add is authorized
|
||||
-- * For all the Stem records I have for this project:
|
||||
-- * Verify I'm not yet a member of the project
|
||||
-- * Verify I haven't already Accepted an Add to this project
|
||||
-- * Verify I haven't already seen an Invite-and-Project-accept for
|
||||
-- * Verify I haven't already Accepted an our-Add to this project
|
||||
-- * Verify I haven't already seen an them-Invite-and-Project-accept for
|
||||
-- this project
|
||||
-- * Insert the Add to my inbox
|
||||
-- * Create a Stem record in DB
|
||||
|
|
|
@ -462,9 +462,11 @@ clientCreateDeck now personMeID (ClientMsg maybeCap localRecips remoteRecips fwd
|
|||
insertDeck now name msummary obiidCreate wid actorMeID = do
|
||||
Entity aid a <- insertActor now name (fromMaybe "" msummary) (Just actorMeID)
|
||||
rid <- insert $ Resource aid
|
||||
kid <- insert $ Komponent rid
|
||||
did <- insert Deck
|
||||
{ deckActor = aid
|
||||
, deckResource = rid
|
||||
, deckKomponent = kid
|
||||
, deckWorkflow = wid
|
||||
, deckNextTicket = 1
|
||||
, deckWiki = Nothing
|
||||
|
|
|
@ -3618,6 +3618,95 @@ changes hLocal ctx =
|
|||
)
|
||||
"errbox"
|
||||
"Inbox"
|
||||
-- 626
|
||||
, addEntities model_626_komponent
|
||||
-- 627
|
||||
, addFieldRefRequired''
|
||||
"Repo"
|
||||
(do inboxID <- insert Inbox627
|
||||
errboxID <- insert Inbox627
|
||||
outboxID <- insert Outbox627
|
||||
followerSetID <- insert FollowerSet627
|
||||
actorID <- insert $ Actor627 "" "" defaultTime inboxID outboxID followerSetID Nothing errboxID
|
||||
resourceID <- insert $ Resource627 actorID
|
||||
insertEntity $ Komponent627 resourceID
|
||||
)
|
||||
(Just $ \ (Entity tempKomponentID (Komponent627 tempResourceID)) -> do
|
||||
l <- selectList [] []
|
||||
for_ l $ \ (Entity k v) -> do
|
||||
kID <- insert $ Komponent627 $ repo627Resource v
|
||||
update k [Repo627Komponent =. kID]
|
||||
|
||||
Resource627 tempActorID <- getJust tempResourceID
|
||||
Actor627 _ _ _ inboxID outboxID followerSetID _ errboxID <- getJust tempActorID
|
||||
delete tempKomponentID
|
||||
delete tempResourceID
|
||||
delete tempActorID
|
||||
delete inboxID
|
||||
delete errboxID
|
||||
delete outboxID
|
||||
delete followerSetID
|
||||
)
|
||||
"komponent"
|
||||
"Komponent"
|
||||
-- 628
|
||||
, addFieldRefRequired''
|
||||
"Deck"
|
||||
(do inboxID <- insert Inbox627
|
||||
errboxID <- insert Inbox627
|
||||
outboxID <- insert Outbox627
|
||||
followerSetID <- insert FollowerSet627
|
||||
actorID <- insert $ Actor627 "" "" defaultTime inboxID outboxID followerSetID Nothing errboxID
|
||||
resourceID <- insert $ Resource627 actorID
|
||||
insertEntity $ Komponent627 resourceID
|
||||
)
|
||||
(Just $ \ (Entity tempKomponentID (Komponent627 tempResourceID)) -> do
|
||||
l <- selectList [] []
|
||||
for_ l $ \ (Entity k v) -> do
|
||||
kID <- insert $ Komponent627 $ deck627Resource v
|
||||
update k [Deck627Komponent =. kID]
|
||||
|
||||
Resource627 tempActorID <- getJust tempResourceID
|
||||
Actor627 _ _ _ inboxID outboxID followerSetID _ errboxID <- getJust tempActorID
|
||||
delete tempKomponentID
|
||||
delete tempResourceID
|
||||
delete tempActorID
|
||||
delete inboxID
|
||||
delete errboxID
|
||||
delete outboxID
|
||||
delete followerSetID
|
||||
)
|
||||
"komponent"
|
||||
"Komponent"
|
||||
-- 629
|
||||
, addFieldRefRequired''
|
||||
"Loom"
|
||||
(do inboxID <- insert Inbox627
|
||||
errboxID <- insert Inbox627
|
||||
outboxID <- insert Outbox627
|
||||
followerSetID <- insert FollowerSet627
|
||||
actorID <- insert $ Actor627 "" "" defaultTime inboxID outboxID followerSetID Nothing errboxID
|
||||
resourceID <- insert $ Resource627 actorID
|
||||
insertEntity $ Komponent627 resourceID
|
||||
)
|
||||
(Just $ \ (Entity tempKomponentID (Komponent627 tempResourceID)) -> do
|
||||
l <- selectList [] []
|
||||
for_ l $ \ (Entity k v) -> do
|
||||
kID <- insert $ Komponent627 $ loom627Resource v
|
||||
update k [Loom627Komponent =. kID]
|
||||
|
||||
Resource627 tempActorID <- getJust tempResourceID
|
||||
Actor627 _ _ _ inboxID outboxID followerSetID _ errboxID <- getJust tempActorID
|
||||
delete tempKomponentID
|
||||
delete tempResourceID
|
||||
delete tempActorID
|
||||
delete inboxID
|
||||
delete errboxID
|
||||
delete outboxID
|
||||
delete followerSetID
|
||||
)
|
||||
"komponent"
|
||||
"Komponent"
|
||||
]
|
||||
|
||||
migrateDB
|
||||
|
|
|
@ -75,6 +75,7 @@ module Vervis.Migration.Entities
|
|||
, model_592_permit_extend
|
||||
, model_601_permit_extend_resource
|
||||
, model_603_resource
|
||||
, model_626_komponent
|
||||
)
|
||||
where
|
||||
|
||||
|
@ -293,3 +294,6 @@ model_601_permit_extend_resource =
|
|||
|
||||
model_603_resource :: [Entity SqlBackend]
|
||||
model_603_resource = $(schema "603_2024-04-20_resource")
|
||||
|
||||
model_626_komponent :: [Entity SqlBackend]
|
||||
model_626_komponent = $(schema "626_2024-04-29_komponent")
|
||||
|
|
|
@ -69,3 +69,6 @@ makeEntitiesMigration "611"
|
|||
|
||||
makeEntitiesMigration "625"
|
||||
$(modelFile "migrations/625_2024-04-27_errbox.model")
|
||||
|
||||
makeEntitiesMigration "627"
|
||||
$(modelFile "migrations/627_2024-04-29_komponent_mig.model")
|
||||
|
|
|
@ -156,6 +156,11 @@ Resource
|
|||
|
||||
UniqueResource actor
|
||||
|
||||
Komponent
|
||||
resource ResourceId
|
||||
|
||||
UniqueKomponent resource
|
||||
|
||||
-- ========================================================================= --
|
||||
-- Delivery
|
||||
-- ========================================================================= --
|
||||
|
@ -307,6 +312,7 @@ Project
|
|||
Deck
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
workflow WorkflowId
|
||||
nextTicket Int
|
||||
wiki RepoId Maybe
|
||||
|
@ -319,6 +325,7 @@ Loom
|
|||
nextTicket Int
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
repo RepoId
|
||||
create OutboxItemId
|
||||
|
||||
|
@ -332,6 +339,7 @@ Repo
|
|||
mainBranch Text
|
||||
actor ActorId
|
||||
resource ResourceId
|
||||
komponent KomponentId
|
||||
create OutboxItemId
|
||||
loom LoomId Maybe
|
||||
|
||||
|
|
Loading…
Reference in a new issue