mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add chat ACL database foundation (#25080)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user