Learn · TrustedAIGov® Enterprise Knowledge Platform
Informational Fresh jira_story: GOV-101

Lesson 1 of 3 — Create onboarding & workspace tables via idempotent migration

Foundations & Tenancy · Source: Jira Story GOV-101 (5 pts) · Authority: Informational (the Jira story is authoritative).

Purpose

Stand up the onboarding/workspace schema with tenant-scoped keys, idempotently.

Why it matters

Idempotent, client_id-scoped migrations are the basis of safe multi-tenancy.

Where this lives

Runs in the Customer AI Governance platform (components: platform). Idempotent migrations create tenant-scoped (client_id FK) tables. Learn teaches this read-only.

Workflow

  1. Given a clean database
  2. When migrations run
  3. Then all tables exist with client_id foreign keys and a re-run is a no-op

Worked example

The migration is run a second time on a populated database. What should happen?

Nothing changes — migrations are idempotent (a no-op on re-run), not duplicating or failing.

Acceptance criteria (authoritative — GOV-101)

Given a clean database, when migrations run, then all tables exist with client_id foreign keys and a re-run is a no-op.

Common pitfalls

  • Non-idempotent migrations that fail or duplicate on re-run.

Knowledge check

  • Scenario: The migration is run a second time on a populated database. What should happen?
  • Look for: Nothing changes — migrations are idempotent (a no-op on re-run), not duplicating or failing.

Key concepts

  • idempotent migration
  • client_id FK
  • multi-tenant schema

For the AI Tutor

  • Summary: Stand up the onboarding/workspace schema with tenant-scoped keys, idempotently.
  • When to use: teaching or answering questions about "create onboarding & workspace tables via idempotent migration".
  • When NOT to use: mapping onboarding outputs to work (that is GOV-130).
  • Key concepts: idempotent migration, client_id FK, multi-tenant schema.

Completion criteria

Learner passes the scenario knowledge check and can point to the system state that satisfies GOV-101's acceptance criterion.

  • Module: LEARN-MOD-002 (Foundations & Tenancy)
  • Provenance: LEARN-MAP-001 · Generation standard: LEARN-STD-002
  • Next: LEARN-LSN-013