b0576f9bf6
Previously there was just CollabTopicAccept, which worked only for local topics but pretended to apply to both, due to directly pointing to Collab, thus possible to insert rows even if there's a CollabTopicRemote. The new situation is a new CollabTopicLocal table to which the local topic things point, thus keeping the local and remote data separate and difficult to confuse.
714 lines
16 KiB
Text
714 lines
16 KiB
Text
-- This file is part of Vervis.
|
|
--
|
|
-- Written in 2016, 2018, 2019, 2020, 2022
|
|
-- by fr33domlover <fr33domlover@riseup.net>.
|
|
--
|
|
-- ♡ Copying is an act of love. Please copy, reuse and share.
|
|
--
|
|
-- The author(s) have dedicated all copyright and related and neighboring
|
|
-- rights to this software to the public domain worldwide. This software is
|
|
-- distributed without any warranty.
|
|
--
|
|
-- You should have received a copy of the CC0 Public Domain Dedication along
|
|
-- with this software. If not, see
|
|
-- <http://creativecommons.org/publicdomain/zero/1.0/>.
|
|
|
|
-- ========================================================================= --
|
|
-- Remote Object
|
|
-- ========================================================================= --
|
|
|
|
Instance
|
|
host Host
|
|
|
|
UniqueInstance host
|
|
|
|
RemoteObject
|
|
instance InstanceId
|
|
ident LocalURI
|
|
|
|
UniqueRemoteObject instance ident
|
|
|
|
RemoteActivity
|
|
ident RemoteObjectId
|
|
content PersistJSONObject
|
|
received UTCTime
|
|
|
|
UniqueRemoteActivity ident
|
|
|
|
UnfetchedRemoteActor
|
|
ident RemoteObjectId
|
|
since UTCTime Maybe
|
|
|
|
UniqueUnfetchedRemoteActor ident
|
|
|
|
RemoteActor
|
|
ident RemoteObjectId
|
|
name Text Maybe
|
|
inbox LocalURI
|
|
followers LocalURI Maybe
|
|
errorSince UTCTime Maybe
|
|
|
|
UniqueRemoteActor ident
|
|
|
|
RemoteCollection
|
|
ident RemoteObjectId
|
|
|
|
UniqueRemoteCollection ident
|
|
|
|
-- ========================================================================= --
|
|
-- Local Actor
|
|
-- ========================================================================= --
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Outbox
|
|
-------------------------------------------------------------------------------
|
|
|
|
Outbox
|
|
|
|
OutboxItem
|
|
outbox OutboxId
|
|
activity PersistJSONObject
|
|
published UTCTime
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Inbox
|
|
-------------------------------------------------------------------------------
|
|
|
|
Inbox
|
|
|
|
InboxItem
|
|
unread Bool
|
|
|
|
InboxItemLocal
|
|
inbox InboxId
|
|
activity OutboxItemId
|
|
item InboxItemId
|
|
|
|
UniqueInboxItemLocal inbox activity
|
|
UniqueInboxItemLocalItem item
|
|
|
|
InboxItemRemote
|
|
inbox InboxId
|
|
activity RemoteActivityId
|
|
item InboxItemId
|
|
|
|
UniqueInboxItemRemote inbox activity
|
|
UniqueInboxItemRemoteItem item
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Followers
|
|
-------------------------------------------------------------------------------
|
|
|
|
FollowerSet
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Actors
|
|
-------------------------------------------------------------------------------
|
|
|
|
Actor
|
|
name Text
|
|
desc Text
|
|
createdAt UTCTime
|
|
inbox InboxId
|
|
outbox OutboxId
|
|
followers FollowerSetId
|
|
|
|
UniqueActorInbox inbox
|
|
UniqueActorOutbox outbox
|
|
UniqueActorFollowers followers
|
|
|
|
Person
|
|
username Username
|
|
login Text
|
|
passphraseHash ByteString
|
|
email EmailAddress
|
|
verified Bool
|
|
verifiedKey Text
|
|
verifiedKeyCreated UTCTime
|
|
resetPassKey Text
|
|
resetPassKeyCreated UTCTime
|
|
actor ActorId
|
|
-- reviewFollow Bool
|
|
|
|
UniquePersonUsername username
|
|
UniquePersonLogin login
|
|
UniquePersonEmail email
|
|
UniquePersonActor actor
|
|
|
|
-- ========================================================================= --
|
|
-- Delivery
|
|
-- ========================================================================= --
|
|
|
|
UnlinkedDelivery
|
|
recipient UnfetchedRemoteActorId
|
|
activity OutboxItemId
|
|
forwarding Bool
|
|
running Bool
|
|
|
|
UniqueUnlinkedDelivery recipient activity
|
|
|
|
Delivery
|
|
recipient RemoteActorId
|
|
activity OutboxItemId
|
|
forwarding Bool
|
|
running Bool
|
|
|
|
UniqueDelivery recipient activity
|
|
|
|
Forwarding
|
|
recipient RemoteActorId
|
|
activity RemoteActivityId
|
|
activityRaw ByteString
|
|
signature ByteString
|
|
running Bool
|
|
|
|
UniqueForwarding recipient activity
|
|
|
|
ForwarderPerson
|
|
task ForwardingId
|
|
sender PersonId
|
|
|
|
UniqueForwarderPerson task
|
|
|
|
ForwarderGroup
|
|
task ForwardingId
|
|
sender GroupId
|
|
|
|
UniqueForwarderGroup task
|
|
|
|
ForwarderRepo
|
|
task ForwardingId
|
|
sender RepoId
|
|
|
|
UniqueForwarderRepo task
|
|
|
|
ForwarderLoom
|
|
task ForwardingId
|
|
sender LoomId
|
|
|
|
UniqueForwarderLoom task
|
|
|
|
ForwarderDeck
|
|
task ForwardingId
|
|
sender DeckId
|
|
|
|
UniqueForwarderDeck task
|
|
|
|
-- ========================================================================= --
|
|
-- ========================================================================= --
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- People
|
|
-------------------------------------------------------------------------------
|
|
|
|
VerifKey
|
|
ident LocalRefURI
|
|
instance InstanceId
|
|
expires UTCTime Maybe
|
|
public PublicVerifKey
|
|
sharer RemoteActorId Maybe
|
|
|
|
UniqueVerifKey instance ident
|
|
|
|
VerifKeySharedUsage
|
|
key VerifKeyId
|
|
user RemoteActorId
|
|
|
|
UniqueVerifKeySharedUsage key user
|
|
|
|
--RemoteFollowRequest
|
|
-- actor RemoteActorId
|
|
-- target PersonId
|
|
--
|
|
-- UniqueRemoteFollowRequest actor target
|
|
--
|
|
|
|
FollowRemoteRequest
|
|
person PersonId
|
|
target FedURI
|
|
recip FedURI Maybe
|
|
public Bool
|
|
activity OutboxItemId
|
|
|
|
UniqueFollowRemoteRequest person target
|
|
UniqueFollowRemoteRequestActivity activity
|
|
|
|
FollowRemote
|
|
actor ActorId
|
|
recip RemoteActorId -- actor managing the followed object
|
|
target FedURI -- the followed object
|
|
public Bool
|
|
follow OutboxItemId
|
|
accept RemoteActivityId
|
|
|
|
UniqueFollowRemote actor target
|
|
UniqueFollowRemoteFollow follow
|
|
UniqueFollowRemoteAccept accept
|
|
|
|
--FollowRequest
|
|
-- person PersonId
|
|
-- target FollowerSetId
|
|
--
|
|
-- UniqueFollowRequest person target
|
|
|
|
Follow
|
|
actor ActorId
|
|
target FollowerSetId
|
|
public Bool
|
|
follow OutboxItemId
|
|
accept OutboxItemId
|
|
|
|
UniqueFollow actor target
|
|
UniqueFollowFollow follow
|
|
UniqueFollowAccept accept
|
|
|
|
RemoteFollow
|
|
actor RemoteActorId
|
|
target FollowerSetId
|
|
public Bool
|
|
follow RemoteActivityId
|
|
accept OutboxItemId
|
|
|
|
UniqueRemoteFollow actor target
|
|
UniqueRemoteFollowFollow follow
|
|
UniqueRemoteFollowAccept accept
|
|
|
|
SshKey
|
|
ident KyIdent
|
|
person PersonId
|
|
algo ByteString
|
|
content ByteString
|
|
|
|
UniqueSshKey person ident
|
|
|
|
Group
|
|
actor ActorId
|
|
|
|
UniqueGroupActor actor
|
|
|
|
GroupMember
|
|
person PersonId
|
|
group GroupId
|
|
role GroupRole
|
|
joined UTCTime
|
|
|
|
UniqueGroupMember person group
|
|
|
|
-- I'm removing the 'sharer' field, so all roles are now public for everyone to
|
|
-- use! This is temporary, until I figure out a sane plan for federated roles
|
|
Role
|
|
ident RlIdent
|
|
desc Text
|
|
|
|
RoleInherit
|
|
parent RoleId
|
|
child RoleId
|
|
|
|
UniqueRoleInherit parent child
|
|
|
|
RoleAccess
|
|
role RoleId
|
|
op ProjectOperation
|
|
|
|
UniqueRoleAccess role op
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Projects
|
|
-------------------------------------------------------------------------------
|
|
|
|
Deck
|
|
actor ActorId
|
|
workflow WorkflowId
|
|
nextTicket Int
|
|
wiki RepoId Maybe
|
|
collabUser RoleId Maybe
|
|
collabAnon RoleId Maybe
|
|
create OutboxItemId
|
|
|
|
UniqueDeckActor actor
|
|
UniqueDeckCreate create
|
|
|
|
Loom
|
|
nextTicket Int
|
|
actor ActorId
|
|
repo RepoId
|
|
create OutboxItemId
|
|
|
|
UniqueLoomActor actor
|
|
UniqueLoomRepo repo
|
|
UniqueLoomCreate create
|
|
|
|
Repo
|
|
vcs VersionControlSystem
|
|
project DeckId Maybe
|
|
mainBranch Text
|
|
collabUser RoleId Maybe
|
|
collabAnon RoleId Maybe
|
|
actor ActorId
|
|
create OutboxItemId
|
|
|
|
UniqueRepoActor actor
|
|
UniqueRepoCreate create
|
|
|
|
-- I removed the 'sharer' field so Workflows don't specify who controls them
|
|
-- For now there's no way to create new ones, and what's already in the DB can
|
|
-- be publicly experimented with, until I make a plan for federated workflows
|
|
Workflow
|
|
ident WflIdent
|
|
name Text Maybe
|
|
desc Text Maybe
|
|
scope WorkflowScope
|
|
|
|
WorkflowField
|
|
workflow WorkflowId
|
|
ident FldIdent
|
|
name Text
|
|
desc Text Maybe
|
|
type WorkflowFieldType
|
|
enm WorkflowEnumId Maybe
|
|
required Bool
|
|
constant Bool
|
|
filterNew Bool
|
|
filterTodo Bool
|
|
filterClosed Bool
|
|
color Int Maybe
|
|
|
|
UniqueWorkflowField workflow ident
|
|
|
|
WorkflowEnum
|
|
workflow WorkflowId
|
|
ident EnmIdent
|
|
name Text
|
|
desc Text Maybe
|
|
|
|
UniqueWorkflowEnum workflow ident
|
|
|
|
WorkflowEnumCtor
|
|
enum WorkflowEnumId
|
|
name Text
|
|
desc Text Maybe
|
|
|
|
UniqueWorkflowEnumCtor enum name
|
|
|
|
TicketParamText
|
|
ticket TicketId
|
|
field WorkflowFieldId
|
|
value Text
|
|
|
|
UniqueTicketParamText ticket field
|
|
|
|
TicketParamEnum
|
|
ticket TicketId
|
|
field WorkflowFieldId
|
|
value WorkflowEnumCtorId
|
|
|
|
UniqueTicketParamEnum ticket field value
|
|
|
|
TicketParamClass
|
|
ticket TicketId
|
|
field WorkflowFieldId
|
|
|
|
UniqueTicketParamClass ticket field
|
|
|
|
Ticket
|
|
number Int Maybe
|
|
created UTCTime
|
|
title Text -- HTML
|
|
source Text -- Pandoc Markdown
|
|
description Text -- HTML
|
|
status TicketStatus
|
|
discuss DiscussionId
|
|
followers FollowerSetId
|
|
accept OutboxItemId
|
|
|
|
-- UniqueTicket project number
|
|
UniqueTicketDiscuss discuss
|
|
UniqueTicketFollowers followers
|
|
UniqueTicketAccept accept
|
|
|
|
TicketAssignee
|
|
ticket TicketId
|
|
person PersonId
|
|
|
|
UniqueTicketAssignee ticket person
|
|
|
|
TicketDeck
|
|
ticket TicketId
|
|
deck DeckId
|
|
|
|
UniqueTicketDeck ticket
|
|
|
|
TicketLoom
|
|
ticket TicketId
|
|
loom LoomId
|
|
branch Text Maybe
|
|
|
|
UniqueTicketLoom ticket
|
|
|
|
TicketAuthorLocal
|
|
ticket TicketId
|
|
author PersonId
|
|
open OutboxItemId
|
|
|
|
UniqueTicketAuthorLocal ticket
|
|
UniqueTicketAuthorLocalOpen open
|
|
|
|
TicketAuthorRemote
|
|
ticket TicketId
|
|
author RemoteActorId
|
|
open RemoteActivityId
|
|
|
|
UniqueTicketAuthorRemote ticket
|
|
UniqueTicketAuthorRemoteOpen open
|
|
|
|
Bundle
|
|
ticket TicketLoomId
|
|
|
|
Patch
|
|
bundle BundleId
|
|
created UTCTime
|
|
type PatchMediaType
|
|
content Text
|
|
|
|
RemoteTicketDependency
|
|
ident RemoteObjectId
|
|
child TicketId
|
|
accept RemoteActivityId
|
|
|
|
UniqueRemoteTicketDependency ident
|
|
UniqueRemoteTicketDependencyAccept accept
|
|
|
|
LocalTicketDependency
|
|
parent TicketId
|
|
created UTCTime
|
|
accept OutboxItemId
|
|
|
|
UniqueLocalTicketDependencyAccept accept
|
|
|
|
TicketDependencyChildLocal
|
|
dep LocalTicketDependencyId
|
|
child TicketId
|
|
|
|
UniqueTicketDependencyChildLocal dep
|
|
|
|
TicketDependencyChildRemote
|
|
dep LocalTicketDependencyId
|
|
child RemoteObjectId
|
|
|
|
UniqueTicketDependencyChildRemote dep
|
|
|
|
TicketDependencyAuthorLocal
|
|
dep LocalTicketDependencyId
|
|
author PersonId
|
|
open OutboxItemId
|
|
|
|
UniqueTicketDependencyAuthorLocal dep
|
|
UniqueTicketDependencyAuthorLocalOpen open
|
|
|
|
TicketDependencyAuthorRemote
|
|
dep LocalTicketDependencyId
|
|
author RemoteActorId
|
|
open RemoteActivityId
|
|
|
|
UniqueTicketDependencyAuthorRemote dep
|
|
UniqueTicketDependencyAuthorRemoteOpen open
|
|
|
|
TicketClaimRequest
|
|
person PersonId
|
|
ticket TicketId
|
|
message Text -- Assume this is Pandoc Markdown
|
|
created UTCTime
|
|
|
|
UniqueTicketClaimRequest person ticket
|
|
|
|
TicketResolve
|
|
ticket TicketId
|
|
accept OutboxItemId
|
|
|
|
UniqueTicketResolve ticket
|
|
UniqueTicketResolveAccept accept
|
|
|
|
TicketResolveLocal
|
|
ticket TicketResolveId
|
|
activity OutboxItemId
|
|
|
|
UniqueTicketResolveLocal ticket
|
|
UniqueTicketResolveLocalActivity activity
|
|
|
|
TicketResolveRemote
|
|
ticket TicketResolveId
|
|
activity RemoteActivityId
|
|
actor RemoteActorId
|
|
|
|
UniqueTicketResolveRemote ticket
|
|
UniqueTicketResolveRemoteActivity activity
|
|
|
|
Discussion
|
|
|
|
RemoteDiscussion
|
|
ident RemoteObjectId
|
|
discuss DiscussionId
|
|
|
|
UniqueRemoteDiscussionIdent ident
|
|
UniqueRemoteDiscussion discuss
|
|
|
|
Message
|
|
created UTCTime
|
|
source Text -- Pandoc Markdown
|
|
content Text -- HTML
|
|
parent MessageId Maybe
|
|
root DiscussionId
|
|
|
|
LocalMessage
|
|
author PersonId
|
|
rest MessageId
|
|
create OutboxItemId
|
|
unlinkedParent FedURI Maybe
|
|
|
|
UniqueLocalMessage rest
|
|
UniqueLocalMessageCreate create
|
|
|
|
RemoteMessage
|
|
author RemoteActorId
|
|
ident RemoteObjectId
|
|
rest MessageId
|
|
create RemoteActivityId
|
|
lostParent FedURI Maybe
|
|
|
|
UniqueRemoteMessageIdent ident
|
|
UniqueRemoteMessage rest
|
|
UniqueRemoteMessageCreate create
|
|
|
|
|
|
------------------------------------------------------------------------------
|
|
-- Collaborators
|
|
------------------------------------------------------------------------------
|
|
|
|
Collab
|
|
|
|
-------------------------------- Collab topic --------------------------------
|
|
|
|
-- Removed for now, until I figure out whether/how to federate custom roles
|
|
--CollabRoleLocal
|
|
-- collab CollabId
|
|
-- role RoleId
|
|
--
|
|
-- UniqueCollabRoleLocal collab
|
|
|
|
CollabTopicLocal
|
|
collab CollabId
|
|
|
|
UniqueCollabTopicLocal collab
|
|
|
|
CollabTopicLocalRepo
|
|
collab CollabTopicLocalId
|
|
repo RepoId
|
|
|
|
UniqueCollabTopicLocalRepo collab
|
|
|
|
CollabTopicLocalDeck
|
|
collab CollabTopicLocalId
|
|
deck DeckId
|
|
|
|
UniqueCollabTopicLocalDeck collab
|
|
|
|
CollabTopicLocalLoom
|
|
collab CollabTopicLocalId
|
|
loom LoomId
|
|
|
|
UniqueCollabTopicLocalLoom collab
|
|
|
|
CollabTopicLocalAccept
|
|
collab CollabTopicLocalId
|
|
accept OutboxItemId
|
|
|
|
UniqueCollabTopicLocalAcceptCollab collab
|
|
UniqueCollabTopicLocalAcceptAccept accept
|
|
|
|
CollabTopicRemote
|
|
collab CollabId
|
|
topic RemoteObjectId
|
|
actor RemoteActorId
|
|
role LocalURI Maybe
|
|
|
|
UniqueCollabTopicRemote collab
|
|
|
|
CollabTopicRemoteAccept
|
|
collab CollabTopicRemoteId
|
|
accept RemoteActivityId
|
|
|
|
UniqueCollabTopicRemoteAcceptCollab collab
|
|
UniqueCollabTopicRemoteAcceptAccept accept
|
|
|
|
-------------------------------- Collab sender -------------------------------
|
|
|
|
CollabSenderLocal
|
|
collab CollabId
|
|
activity OutboxItemId
|
|
|
|
UniqueCollabSenderLocal collab
|
|
UniqueCollabSenderLocalActivity activity
|
|
|
|
CollabSenderRemote
|
|
collab CollabId
|
|
actor RemoteActorId
|
|
activity RemoteActivityId
|
|
|
|
UniqueCollabSenderRemote collab
|
|
UniqueCollabSenderRemoteActivity activity
|
|
|
|
-------------------------------- Collab recipient ----------------------------
|
|
|
|
CollabRecipLocal
|
|
collab CollabId
|
|
person PersonId
|
|
|
|
UniqueCollabRecipLocal collab
|
|
|
|
CollabRecipLocalAccept
|
|
collab CollabRecipLocalId
|
|
accept OutboxItemId
|
|
|
|
UniqueCollabRecipLocalAcceptCollab collab
|
|
UniqueCollabRecipLocalAcceptAccept accept
|
|
|
|
CollabRecipRemote
|
|
collab CollabId
|
|
actor RemoteActorId
|
|
|
|
UniqueCollabRecipRemote collab
|
|
|
|
CollabRecipRemoteAccept
|
|
collab CollabRecipRemoteId
|
|
accept RemoteActivityId
|
|
|
|
UniqueCollabRecipRemoteAcceptCollab collab
|
|
UniqueCollabRecipRemoteAcceptAccept accept
|
|
|
|
-------------------------------- Collab reason -------------------------------
|
|
|
|
CollabFulfillsLocalTopicCreation
|
|
collab CollabId
|
|
|
|
UniqueCollabFulfillsLocalTopicCreation collab
|
|
|
|
------------------------------------------------------------------------------
|
|
------------------------------------------------------------------------------
|
|
|
|
--RepoRemoteCollab
|
|
-- repo RepoId
|
|
-- collab RemoteActorId
|
|
-- role RoleId Maybe
|
|
-- cap Text
|
|
--
|
|
-- UniqueRepoRemoteCollab repo collab
|
|
-- UniqueRepoRemoteCollabCap cap
|
|
--
|
|
--ProjectRemoteCollab
|
|
-- project DeckId
|
|
-- collab RemoteActorId
|
|
-- role RoleId Maybe
|
|
-- cap Text
|
|
--
|
|
-- UniqueProjectRemoteCollab project person
|
|
-- UniqueProjectRemoteCollabCap cap
|