- 20260915090000_betrieb_client_id_per_tenant (Aufräumpunkt f, L8 offener Punkt 6): globale Unique-Indizes auf client_id (material_usages, work_sessions, time_entries, activity_notes, photos, voice_notes, reports, signatures) → @@unique([tenantId, clientId]). Offline-IDs sind nur je Mandant eindeutig; ein Replay derselben ID in einem anderen Mandanten scheiterte bisher mit internem Fehler. Keine neuen Tabellen. - 20260915091000_betrieb_ai_token_limit (Aufräumpunkt k): tenant_settings.ai_monthly_token_limit (NULL = Plattform-Vorgabe AI_MONTHLY_TOKEN_LIMIT, 0 = unbegrenzt). Keine neue Tabelle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 lines
410 B
SQL
8 lines
410 B
SQL
-- L10b Betrieb & Aufräumen (Aufräumpunkt k, Spec §31 Kostenlimit):
|
|
-- Optional monthly AI token budget (input + output tokens of AiGeneration) per tenant.
|
|
-- NULL = platform default from env AI_MONTHLY_TOKEN_LIMIT, 0 = unlimited.
|
|
-- tenant_settings is already tenant-bound (RLS, TENANT_MODELS) — no new table.
|
|
|
|
-- AlterTable
|
|
ALTER TABLE "tenant_settings" ADD COLUMN "ai_monthly_token_limit" INTEGER;
|