Skip to content

Refuse to delete a principal who owns a credential - #217

Merged
alexanderguy merged 2 commits into
mainfrom
intr-494-deleting-a-principal-silently-converts-their-personal
Oct 8, 2026
Merged

alexanderguy merged 2 commits into
mainfrom
intr-494-deleting-a-principal-silently-converts-their-personal

Conversation

@alexanderguy

Copy link
Copy Markdown
Member

Summary

  • A personal credential's principal foreign key is ON DELETE RESTRICT. Null remains the tenant-owned marker, and the credential stays bound to its principal until the credential row itself is deleted.
  • DELETE /api/tenants/:tenantId/principals/:principalId returns 409 Principal is still referenced when a foreign key still points at the principal. A principal with no such reference is removed, and a tenant-owned credential stays tenant-owned.
  • Deleting the tenant removes the tenant, its principals, and its credentials.

Verification

  • gmake all exits 0 on this branch: 933 pass, 2 skip, 0 fail. The two skips are the live Google GenAI tests.
  • The branch is current with origin/main.

Closes INTR-494

@alexanderguy

Copy link
Copy Markdown
Member Author

Self-review (code-review skill) returned clean.

@linear

linear Bot commented Oct 8, 2026

Copy link
Copy Markdown

INTR-494

@alexanderguy
alexanderguy merged commit 1ea78ec into main Oct 8, 2026
6 checks passed
@alexanderguy
alexanderguy deleted the intr-494-deleting-a-principal-silently-converts-their-personal branch October 8, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant