feat: add chat ACL database foundation (#25080)

This commit is contained in:
Danielle Maywood
2026-05-14 17:18:50 +01:00
committed by GitHub
parent 507ece3bc4
commit 9ddfafe2b1
13 changed files with 1683 additions and 188 deletions
+13
View File
@@ -98,6 +98,19 @@ func TestViewSubsetWorkspace(t *testing.T) {
}
}
func TestViewSubsetChat(t *testing.T) {
t.Parallel()
table := reflect.TypeOf(database.ChatTable{})
joined := reflect.TypeOf(database.Chat{})
tableFields := allFields(table)
joinedFields := allFields(joined)
if !assert.Subset(t, fieldNames(joinedFields), fieldNames(tableFields), "table is not subset") {
t.Log("Some fields were added to the Chat Table without updating the 'chats_expanded' view.")
t.Log("See migration 000496_chat_database_foundation.up.sql to create the view.")
}
}
func fieldNames(fields []reflect.StructField) []string {
names := make([]string, len(fields))
for i, field := range fields {