-
Notifications
You must be signed in to change notification settings - Fork 875
feat: enable soft delete for organizations #16584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jaaydenh
commented
Feb 16, 2025
•
edited
Loading
edited
- Add deleted column to organizations table
- Add trigger to check for existing workspaces, templates, groups and members in a org before allowing the soft delete
87af79e
to
44a9cad
Compare
coderd/database/migrations/000295_organization_soft_delete.up.sql
Outdated
Show resolved
Hide resolved
6d8239c
to
083bf7f
Compare
f23940d
to
70bf5e3
Compare
-- * the organization has 1 or more groups other than "Everyone" group | ||
-- * the organization has 1 or more members other than the organization owner | ||
|
||
IF (workspace_count + template_count) > 0 THEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels like such a long error message if this is combined into one exception. In the future the FE should let the user know what resources exist before deleting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can improve the error handling in golang up front in the future and improve the UX on failures.
coderd/database/migrations/000296_organization_soft_delete.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once tests are in, I will ✔️
(Jaayden and I went over the trigger together in a call)
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>