Arbeitsbereiche bereitstellen und migrieren
Behandelt Erstellung, Migration und Stilllegung von Arbeitsbereichen als wiederherstellbare Vorgänge mit Fortschritt in allen betroffenen Speichern.
tenant-provisioning-data-migration
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze ihn bei unterbrochenem Onboarding, fortsetzbaren Backfills oder geregelten Transfers zwischen Arbeitsbereichen.
Wobei hilft er dir?
- Macht Kernerstellung atomar und Wiederholungen abgleichbar.
- Verfolgt Migrationsfortschritt und Teilfehler je Mandant.
- Definiert Transferrechte und vollständige Stilllegung über alle Speicherschichten.
Das könntest du fragen
Setze unterbrochene Bereitstellung ohne doppelte Eigentümer oder Standardressourcen fort. Unterbrich nach Arbeitsbereichserstellung vor Standardordnerabschluss. Setze mit derselben Vorgangskennung fort und gleiche bestehende Ressourcen ab, statt sie zu duplizieren.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Tenant Provisioning & Data Migration
When to Use
Use when implementing workspace creation/onboarding, running schema or data migrations across tenants, transferring resources between workspaces, or deprovisioning and purging a workspace.
1. Idempotent Workspace Provisioning
Creating a workspace often spans multiple steps (creating the workspaces row, assigning the creator as owner in workspace_memberships, seeding default roles/settings/templates, initializing billing/quota records, and provisioning storage/search namespaces):
- Atomic Core + Reconcilable Provisioning State:
- Execute core database creation (
workspace+ initialownermembership + default config) inside a single atomic DB transaction so a workspace is never created with0owners. - If external provisioning is required (Stripe customer creation, dedicated search index, default storage prefix), track
provisioning_status(provisioning$\rightarrow$active/provisioning_failed) with idempotent retry keys so network retries never create duplicate external resources.
- Execute core database creation (
2. Multi-Tenant Schema & Data Backfill Discipline
- Shared-Schema Migrations:
- Remember that
ALTER TABLEor backfilling a table shared by 10,000 tenants locks or taxes I/O for every active customer simultaneously. Use non-blocking expand-and-contract steps (ADD COLUMN NULL, batched per-tenant background backfill,CREATE INDEX CONCURRENTLY).
- Remember that
- Schema-per-Tenant / DB-per-Tenant Migrations (when applicable):
- Track migration version per tenant, run migrations with bounded concurrency, and isolate failures so one tenant with corrupt legacy data does not halt deployment for healthy tenants.
3. Controlled Cross-Workspace Resource Copy / Move
Never allow ad-hoc UPDATE table SET workspace_id = $new WHERE id = $id! Moving a parent row without moving its entire transitive dependency graph creates cross-tenant foreign-key corruption:
- Explicit Transfer Rules:
- Verify the actor holds export/move permission in the source workspace and create/import permission in the target workspace.
- Enumerate the full closure of dependent records (child rows, attachments/storage blobs, comments, tags) and either deep-copy/re-key them into the target workspace with new IDs and storage keys, or update the entire subgraph atomically while stripping source-workspace-specific references (e.g., user assignees who are not members of the target workspace, source webhook/integration IDs).
- Record audit log entries in both the source and target workspaces.
4. Complete Workspace Deprovisioning & GDPR Erasure
When a workspace transitions from pending_deletion (grace period) to permanent erasure:
- Purge in deterministic order across every storage tier:
- Cancel active background jobs, webhooks, and external subscriptions.
- Delete search index documents and vector embeddings for
tenant_id. - Delete object storage blobs (
tenants/${tenantId}/...) and invalidate CDN/Redis caches. - Delete relational database records in foreign-key order (or via verified
ON DELETE CASCADEin batched chunks to avoid long table locks) and record a minimal tombstoned erasure certificate for compliance.
Enthaltene Dateien 1
SKILL.md
