Skip to content

fix(admin): delete organization instances - #88

Open
efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:fix/61-delete-org-instances
Open

efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:fix/61-delete-org-instances

Conversation

@efegokdemir

Copy link
Copy Markdown

What this changes

Delete an operator-managed organization together with its stored instance connections. Instance rows were only soft-deleted before the organization delete, so SQLite foreign-key enforcement rejected the transaction and retained the organization data.

Why

The instances.org_id foreign key has no cascade, and instance_events.instance_id also requires its rows to be removed first. The deletion helper now removes instance events, instances (including stored admin tokens), invitations, and memberships in one transaction before deleting the organization.

Testing

  • npm test — passed (230 tests)
  • npm run check — passed with 0 errors and 10 pre-existing warnings
  • LAUNCHPAD_JWT_SECRET=test npm run build — passed
  • git diff --check — passed

Closes #61

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA. Thanks!
Posted by the CLA Assistant Lite bot.

@efegokdemir

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

fix(admin): deleting an org fails when it has instances

1 participant