Represent channel relationships using paths table

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-08-09 10:36:27 -07:00
parent 498d043a0a
commit 778fd6b0a9
4 changed files with 80 additions and 78 deletions

View file

@ -2,12 +2,11 @@ use super::ChannelId;
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, Default, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "channel_parents")]
#[sea_orm(table_name = "channel_paths")]
pub struct Model {
#[sea_orm(primary_key)]
pub child_id: ChannelId,
#[sea_orm(primary_key)]
pub parent_id: ChannelId,
pub id_path: String,
pub channel_id: ChannelId,
}
impl ActiveModelBehavior for ActiveModel {}