chore: add template_with_user view to include user contextual data (#8568)

* chore: Refactor template sql queries to use new view
* TemplateWithUser -> Template
* Add unit test to enforce good view
This commit is contained in:
Steven Masley
2023-07-19 16:07:33 -04:00
committed by GitHub
parent cdbae29a83
commit aceedefce3
25 changed files with 453 additions and 358 deletions
+12
View File
@@ -21,12 +21,24 @@ overrides:
- column: "templates.group_acl"
go_type:
type: "TemplateACL"
- column: "template_with_users.user_acl"
go_type:
type: "TemplateACL"
- column: "template_with_users.group_acl"
go_type:
type: "TemplateACL"
- column: "template_with_users.created_by_avatar_url"
go_type:
type: "string"
rename:
template: TemplateTable
template_with_user: Template
api_key: APIKey
api_key_scope: APIKeyScope
api_key_scope_all: APIKeyScopeAll
api_key_scope_application_connect: APIKeyScopeApplicationConnect
avatar_url: AvatarURL
created_by_avatar_url: CreatedByAvatarURL
session_count_vscode: SessionCountVSCode
session_count_jetbrains: SessionCountJetBrains
session_count_reconnecting_pty: SessionCountReconnectingPTY