-- L10b Betrieb & Aufräumen (Aufräumpunkt f, L8 offener Punkt 6): -- Offline client ids are generated per device and only need to be unique within a tenant. -- A global unique index let a replay with the same client id in another tenant fail with an -- internal error (and leaked the existence of the id across tenants). Tables already carry -- tenant RLS; no new tables. -- DropIndex DROP INDEX "activity_notes_client_id_key"; -- DropIndex DROP INDEX "material_usages_client_id_key"; -- DropIndex DROP INDEX "photos_client_id_key"; -- DropIndex DROP INDEX "reports_client_id_key"; -- DropIndex DROP INDEX "signatures_client_id_key"; -- DropIndex DROP INDEX "time_entries_client_id_key"; -- DropIndex DROP INDEX "voice_notes_client_id_key"; -- DropIndex DROP INDEX "work_sessions_client_id_key"; -- CreateIndex CREATE UNIQUE INDEX "activity_notes_tenant_id_client_id_key" ON "activity_notes"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "material_usages_tenant_id_client_id_key" ON "material_usages"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "photos_tenant_id_client_id_key" ON "photos"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "reports_tenant_id_client_id_key" ON "reports"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "signatures_tenant_id_client_id_key" ON "signatures"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "time_entries_tenant_id_client_id_key" ON "time_entries"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "voice_notes_tenant_id_client_id_key" ON "voice_notes"("tenant_id", "client_id"); -- CreateIndex CREATE UNIQUE INDEX "work_sessions_tenant_id_client_id_key" ON "work_sessions"("tenant_id", "client_id");