Skip to content

ConnectorRegistryService — DDL appendix

Generated from the architecture model

This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.

Dialect shown: SQL Server (nvarchar, uniqueidentifier, datetimeoffset). Migrations are authored as FluentMigrator classes in the service's DatabaseModel.Migrations project; the TenantId column and the NHibernate tenant filter follow canonical ADR-0100 in SharedDb mode.

dbo.ConnectorDescriptors

Owner: ConnectorDescriptor

CREATE TABLE [dbo].[ConnectorDescriptors] (
    [ConnectorId] nvarchar(64) NOT NULL,
    [Version] nvarchar(32) NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [Provider] nvarchar(64) NOT NULL,
    [CapabilitiesJson] nvarchar(2000) NOT NULL,
    [AdapterRef] nvarchar(256) NOT NULL,
    [RetryProfileJson] nvarchar(512) NOT NULL,
    [RateLimitProfileJson] nvarchar(512) NOT NULL,
    [WebhookSchemeJson] nvarchar(1024) NULL,
    [ConfigurationForm] nvarchar(512) NOT NULL,
    [CertificationRef] nvarchar(512) NULL,
    [State] int NOT NULL,
    [ReleaseId] nvarchar(256) NULL,
    CONSTRAINT [PK_ConnectorDescriptors] PRIMARY KEY ([ConnectorId], [Version])
);
Column Type Null Key Description
ConnectorId nvarchar(64) no PK
Version nvarchar(32) no PK
TenantId nvarchar(64) no
Provider nvarchar(64) no
CapabilitiesJson nvarchar(2000) no
AdapterRef nvarchar(256) no
RetryProfileJson nvarchar(512) no
RateLimitProfileJson nvarchar(512) no
WebhookSchemeJson nvarchar(1024) yes
ConfigurationForm nvarchar(512) no
CertificationRef nvarchar(512) yes
State int no
ReleaseId nvarchar(256) yes

dbo.Subscriptions

Owner: Subscription

CREATE TABLE [dbo].[Subscriptions] (
    [SubscriptionId] uniqueidentifier NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [ProjectId] nvarchar(64) NULL,
    [ConnectorId] nvarchar(64) NOT NULL,
    [ConnectionId] uniqueidentifier NOT NULL,
    [EventTypesJson] nvarchar(2000) NOT NULL,
    [TargetJson] nvarchar(1024) NOT NULL,
    [IngressRef] nvarchar(256) NOT NULL,
    [Active] bit NOT NULL DEFAULT (1),
    [LastDeliveryAt] datetimeoffset NULL,
    CONSTRAINT [PK_Subscriptions] PRIMARY KEY ([SubscriptionId])
);
CREATE UNIQUE INDEX [UX_Subscriptions_Ingress] ON [dbo].[Subscriptions] ([IngressRef]);
Column Type Null Key Description
SubscriptionId uniqueidentifier no PK
TenantId nvarchar(64) no
ProjectId nvarchar(64) yes
ConnectorId nvarchar(64) no
ConnectionId uniqueidentifier no
EventTypesJson nvarchar(2000) no
TargetJson nvarchar(1024) no
IngressRef nvarchar(256) no
Active bit no
LastDeliveryAt datetimeoffset yes

dbo.Deliveries

Owner: Delivery · Retention: 90 days; receipts referenced by audit evidence 7 years

CREATE TABLE [dbo].[Deliveries] (
    [DeliveryId] uniqueidentifier NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [Direction] int NOT NULL,
    [ConnectorId] nvarchar(64) NOT NULL,
    [ConnectionId] uniqueidentifier NOT NULL,
    [SubscriptionId] uniqueidentifier NULL,
    [ExternalId] nvarchar(256) NOT NULL,
    [DedupKey] nvarchar(256) NOT NULL,
    [State] int NOT NULL,
    [PayloadRef] nvarchar(512) NOT NULL,
    [PayloadHash] nvarchar(128) NOT NULL,
    [Attempts] int NOT NULL DEFAULT (0),
    [ReceiptRef] nvarchar(512) NULL,
    [ReceivedAt] datetimeoffset NOT NULL,
    [SettledAt] datetimeoffset NULL,
    CONSTRAINT [PK_Deliveries] PRIMARY KEY ([DeliveryId])
);
ALTER TABLE [dbo].[Deliveries] ADD CONSTRAINT [FK_Deliveries_Subscriptions_SubscriptionId] FOREIGN KEY ([SubscriptionId]) REFERENCES [dbo].[Subscriptions] ([SubscriptionId]);
CREATE UNIQUE INDEX [UX_Deliveries_Dedup] ON [dbo].[Deliveries] ([TenantId], [ConnectorId], [DedupKey]);
CREATE INDEX [IX_Deliveries_State_ReceivedAt] ON [dbo].[Deliveries] ([State], [ReceivedAt]);
Column Type Null Key Description
DeliveryId uniqueidentifier no PK
TenantId nvarchar(64) no
Direction int no
ConnectorId nvarchar(64) no
ConnectionId uniqueidentifier no
SubscriptionId uniqueidentifier yes FK → Subscriptions.SubscriptionId
ExternalId nvarchar(256) no
DedupKey nvarchar(256) no
State int no
PayloadRef nvarchar(512) no
PayloadHash nvarchar(128) no
Attempts int no
ReceiptRef nvarchar(512) yes
ReceivedAt datetimeoffset no
SettledAt datetimeoffset yes