Files
tenant-registry/migrations/0013_managed_services_ci_runner.up.sql
T
Sharang ParnerkarandClaude Opus 5.5 f0a6c3f2ae
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 24m25s
ci / image (pull_request) Skipped
feat(services): build runners INF-CI-* and managed service kind ci-runner
ERP items INF-CI-CLD-STD/BUS/ENT (Monat, 149/290/590 EUR) and
INF-CI-OPR-STD/BUS/ENT (Jahr, 2900/5900/11900 EUR), priced per runner:
a dedicated build machine per customer, never shared (2 vCPU/4 GB,
4 vCPU/8 GB, 8 vCPU/16 GB).

Migration 0013 adds the managed service kind ci-runner (SKU
^INF-CI-(CLD|OPR)-(STD|BUS|ENT)$). A runner's url is the Git instance it
serves, so the (tenant, kind, url) uniqueness now holds for kind git only
(partial unique index); several runners may serve one instance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-10-05 19:41:51 +02:00

13 lines
750 B
SQL

-- Build runners (INF-CI-{CLD,OPR}-{STD,BUS,ENT}): a dedicated build machine per
-- customer, never shared, registered with the customer's Managed Git
-- instance. Kind `ci-runner`; its url is the Git instance it serves.
--
-- Runners are priced per runner, so one Git instance may have several: the
-- (tenant, kind, url) uniqueness of 0012 now holds for kind `git` only.
ALTER TABLE managed_services DROP CONSTRAINT managed_services_kind_check;
ALTER TABLE managed_services ADD CONSTRAINT managed_services_kind_check
CHECK (kind IN ('git', 'ci-runner'));
ALTER TABLE managed_services DROP CONSTRAINT managed_services_tenant_id_kind_url_key;
CREATE UNIQUE INDEX managed_services_git_url ON managed_services (tenant_id, url) WHERE kind = 'git';