feat: remove namespaces, make projects infinitely nestable #1362

Merged
konrad merged 68 commits from feature/namespaces-be-gone into main 2023-05-24 14:14:03 +00:00
1 changed files with 0 additions and 7 deletions
Showing only changes of commit 2dcd6451a4 - Show all commits

View File

@ -403,20 +403,13 @@ func getUserProjectsStatement(userID int64, search string, getArchived bool) *bu
return builder.Dialect(dialect).
Select("l.*").
From("projects", "l").
// TODO: remove namespaces
Join("INNER", "namespaces n", "l.namespace_id = n.id").
Join("LEFT", "team_namespaces tn", "tn.namespace_id = n.id").
Join("LEFT", "team_members tm", "tm.team_id = tn.team_id").
Join("LEFT", "team_projects tl", "l.id = tl.project_id").
Join("LEFT", "team_members tm2", "tm2.team_id = tl.team_id").
Join("LEFT", "users_projects ul", "ul.project_id = l.id").
Join("LEFT", "users_namespaces un", "un.namespace_id = l.namespace_id").
Where(builder.And(
builder.Or(
builder.Eq{"tm.user_id": userID},
builder.Eq{"tm2.user_id": userID},
builder.Eq{"ul.user_id": userID},
builder.Eq{"un.user_id": userID},
builder.Eq{"l.owner_id": userID},
),
filterCond,