Skip to content

StudioBff — 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.StudioSessions

Owner: StudioSession · Retention: 30 days

CREATE TABLE [dbo].[StudioSessions] (
    [SessionId] uniqueidentifier NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [UserId] nvarchar(128) NOT NULL,
    [ScopeJson] nvarchar(1024) NOT NULL,
    [PermissionsSnapshotJson] nvarchar(max) NOT NULL,
    [Locale] nvarchar(5) NOT NULL,
    [Theme] nvarchar(8) NOT NULL,
    [ReducedMotion] bit NOT NULL DEFAULT (0),
    [WorkArea] int NOT NULL,
    [SubscriptionsJson] nvarchar(2000) NOT NULL,
    [StartedAt] datetimeoffset NOT NULL,
    [LastSeenAt] datetimeoffset NOT NULL,
    CONSTRAINT [PK_StudioSessions] PRIMARY KEY ([SessionId])
);
CREATE INDEX [IX_Sessions_User] ON [dbo].[StudioSessions] ([TenantId], [UserId], [LastSeenAt]);
Column Type Null Key Description
SessionId uniqueidentifier no PK
TenantId nvarchar(64) no
UserId nvarchar(128) no
ScopeJson nvarchar(1024) no
PermissionsSnapshotJson nvarchar(max) no
Locale nvarchar(5) no
Theme nvarchar(8) no
ReducedMotion bit no
WorkArea int no
SubscriptionsJson nvarchar(2000) no
StartedAt datetimeoffset no
LastSeenAt datetimeoffset no

dbo.SavedViews

Owner: SavedView

CREATE TABLE [dbo].[SavedViews] (
    [ViewId] uniqueidentifier NOT NULL,
    [TenantId] nvarchar(64) NOT NULL,
    [OwnerUserId] nvarchar(128) NOT NULL,
    [ScreenId] nvarchar(64) NOT NULL,
    [Name] nvarchar(128) NOT NULL,
    [DefinitionJson] nvarchar(max) NOT NULL,
    [SharedWith] nvarchar(16) NOT NULL,
    [UpdatedAt] datetimeoffset NOT NULL,
    CONSTRAINT [PK_SavedViews] PRIMARY KEY ([ViewId])
);
CREATE INDEX [IX_Views_Screen] ON [dbo].[SavedViews] ([TenantId], [ScreenId], [SharedWith]);
Column Type Null Key Description
ViewId uniqueidentifier no PK
TenantId nvarchar(64) no
OwnerUserId nvarchar(128) no
ScreenId nvarchar(64) no
Name nvarchar(128) no
DefinitionJson nvarchar(max) no
SharedWith nvarchar(16) no
UpdatedAt datetimeoffset no