env(admin): per-environment color field + V2 migration

- V2__add_environment_color.sql adds a CHECK-constrained VARCHAR color column (default 'slate'); existing rows backfill to slate.
- Environment record + EnvironmentColor constants (8 preset values) flow through repository, service, and admin API.
- UpdateEnvironmentRequest.color nullable: null preserves existing; unknown values → 400.
- ITs cover valid / invalid / null-preserves behaviour; existing Environment constructor call-sites updated with the new color arg.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-22 19:24:30 +02:00
parent 88b003d4f0
commit c2eab71a31
15 changed files with 147 additions and 18 deletions

View File

@@ -0,0 +1,6 @@
-- V2: per-environment color for UI indicator
-- Added after V1 baseline (2026-04-22). 8-swatch preset palette; default 'slate'.
ALTER TABLE environments
ADD COLUMN color VARCHAR(16) NOT NULL DEFAULT 'slate'
CHECK (color IN ('slate','red','amber','green','teal','blue','purple','pink'));