feat: enable soft delete for organizations (#16584)

- 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

---------

Co-authored-by: Steven Masley <stevenmasley@gmail.com>
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
This commit is contained in:
Jaayden Halko
2025-02-24 17:59:41 +00:00
committed by GitHub
parent dfa33b11d9
commit 546a549dcf
28 changed files with 605 additions and 215 deletions

View File

@ -73,7 +73,10 @@ func ExtractOrganizationParam(db database.Store) func(http.Handler) http.Handler
if err == nil {
organization, dbErr = db.GetOrganizationByID(ctx, id)
} else {
organization, dbErr = db.GetOrganizationByName(ctx, arg)
organization, dbErr = db.GetOrganizationByName(ctx, database.GetOrganizationByNameParams{
Name: arg,
Deleted: false,
})
}
}
if httpapi.Is404Error(dbErr) {