Files
tenant-registry/migrations/0012_managed_services.up.sql
sharangandClaude Opus 5.5 85934567f1
ci / shared (push) Successful in 13s
ci / test (push) Successful in 24m12s
ci / image (push) Successful in 35s
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 24m17s
ci / image (pull_request) Skipped
feat(services): managed services per tenant for the portal (#77) (#61)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-10-04 19:33:20 +00:00

22 lines
1.1 KiB
SQL

-- Managed services (portal#77): infrastructure BreakPilot runs for a tenant,
-- for now Managed Git (one Gitea instance per customer, SKUs
-- INF-GIT-{CLD,OPR}-{STD,BUS,ENT}). Provisioned by hand (v0); staff keep the
-- record in the admin area and the portal shows it under "Verwaltete
-- Infrastruktur". instance_id and notes are staff-only.
CREATE TABLE managed_services (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
kind TEXT NOT NULL CHECK (kind IN ('git')),
name TEXT NOT NULL,
url TEXT NOT NULL,
sku TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'provisioning'
CHECK (status IN ('provisioning', 'active', 'restricted', 'halted')),
instance_id TEXT NOT NULL DEFAULT '',
notes TEXT NOT NULL DEFAULT '',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
UNIQUE (tenant_id, kind, url)
);
CREATE INDEX managed_services_tenant ON managed_services (tenant_id);