Fix slow query for fetching descendants of channels (#7008)

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Conrad Irwin 2024-01-29 14:24:59 -07:00 committed by GitHub
parent 1313402a6b
commit c008c78e87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 69 deletions

View file

@ -39,6 +39,10 @@ impl Model {
pub fn path(&self) -> String {
format!("{}{}/", self.parent_path, self.id)
}
pub fn descendant_path_filter(&self) -> String {
format!("{}{}/%", self.parent_path, self.id)
}
}
impl ActiveModelBehavior for ActiveModel {}