Skip to content

IaCProvisioningService — 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.DeploymentSpecifications

Owner: DeploymentSpecification

CREATE TABLE [dbo].[DeploymentSpecifications] (
    [SpecificationId] uniqueidentifier NOT NULL,
    [Version] int NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [ProjectId] nvarchar(64) NOT NULL,
    [EnvironmentId] nvarchar(64) NOT NULL,
    [Kind] int NOT NULL,
    [ProgramRef] nvarchar(512) NOT NULL,
    [ProgramVersion] nvarchar(64) NOT NULL,
    [ReleaseId] uniqueidentifier NULL,
    [Strategy] nvarchar(16) NULL,
    [ConfigRefsJson] nvarchar(max) NOT NULL,
    [SecretRefsJson] nvarchar(max) NOT NULL,
    [DeclaredAt] datetimeoffset NOT NULL,
    CONSTRAINT [PK_DeploymentSpecifications] PRIMARY KEY ([SpecificationId], [Version])
);
CREATE INDEX [IX_Specs_Env_Kind] ON [dbo].[DeploymentSpecifications] ([TenantId], [EnvironmentId], [Kind], [Version]);
Column Type Null Key Description
SpecificationId uniqueidentifier no PK
Version int no PK
TenantId nvarchar(64) no
ProjectId nvarchar(64) no
EnvironmentId nvarchar(64) no
Kind int no
ProgramRef nvarchar(512) no
ProgramVersion nvarchar(64) no
ReleaseId uniqueidentifier yes
Strategy nvarchar(16) yes
ConfigRefsJson nvarchar(max) no
SecretRefsJson nvarchar(max) no
DeclaredAt datetimeoffset no

dbo.ProvisioningRuns

Owner: ProvisioningRun · Retention: lifetime of the environment plus 7 years for receipts

CREATE TABLE [dbo].[ProvisioningRuns] (
    [ProvisioningRunId] uniqueidentifier NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [ProjectId] nvarchar(64) NOT NULL,
    [EnvironmentId] nvarchar(64) NOT NULL,
    [SpecificationId] uniqueidentifier NOT NULL,
    [SpecificationVersion] int NOT NULL,
    [Kind] int NOT NULL,
    [PromotionId] uniqueidentifier NULL,
    [ApprovalId] uniqueidentifier NULL,
    [PlanReceiptJson] nvarchar(max) NULL,
    [ApplyReceiptJson] nvarchar(max) NULL,
    [State] int NOT NULL,
    [LogsRef] nvarchar(512) NULL,
    [StartedAt] datetimeoffset NOT NULL,
    [CompletedAt] datetimeoffset NULL,
    CONSTRAINT [PK_ProvisioningRuns] PRIMARY KEY ([ProvisioningRunId])
);
CREATE INDEX [IX_ProvRuns_Env_State] ON [dbo].[ProvisioningRuns] ([TenantId], [EnvironmentId], [State], [StartedAt]);
CREATE INDEX [IX_ProvRuns_Promotion] ON [dbo].[ProvisioningRuns] ([PromotionId]);
Column Type Null Key Description
ProvisioningRunId uniqueidentifier no PK
TenantId nvarchar(64) no
ProjectId nvarchar(64) no
EnvironmentId nvarchar(64) no
SpecificationId uniqueidentifier no
SpecificationVersion int no
Kind int no
PromotionId uniqueidentifier yes
ApprovalId uniqueidentifier yes
PlanReceiptJson nvarchar(max) yes
ApplyReceiptJson nvarchar(max) yes
State int no
LogsRef nvarchar(512) yes
StartedAt datetimeoffset no
CompletedAt datetimeoffset yes