generalbots/src/core/shared/schema/kb.rs
Rodrigo Rodriguez (Pragmatismo) 73d9531563
All checks were successful
BotServer CI/CD / build (push) Successful in 8m7s
fix: buffer HTML chunks to avoid flashing, flush on closing tags
2026-04-14 14:22:07 -03:00

33 lines
984 B
Rust

use crate::core::shared::schema::core::bots;
use crate::core::shared::schema::core::rbac_groups;
use crate::core::shared::schema::core::users;
diesel::table! {
kb_collections (id) {
id -> Uuid,
bot_id -> Uuid,
name -> Text,
folder_path -> Text,
qdrant_collection -> Text,
document_count -> Int4,
created_at -> Timestamptz,
updated_at -> Timestamptz,
}
}
diesel::table! {
kb_group_associations (id) {
id -> Uuid,
kb_id -> Uuid,
group_id -> Uuid,
granted_by -> Nullable<Uuid>,
granted_at -> Timestamptz,
}
}
diesel::joinable!(kb_collections -> bots (bot_id));
diesel::joinable!(kb_group_associations -> kb_collections (kb_id));
diesel::joinable!(kb_group_associations -> rbac_groups (group_id));
diesel::joinable!(kb_group_associations -> users (granted_by));
diesel::allow_tables_to_appear_in_same_query!(kb_collections, kb_group_associations,);