Parent and child posts
This commit is contained in:
parent
04f888c323
commit
54379b98e0
16 changed files with 334 additions and 58 deletions
|
|
@ -24,6 +24,8 @@ pub struct Model {
|
|||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::samey_pool_post::Entity")]
|
||||
SameyPoolPost,
|
||||
#[sea_orm(
|
||||
belongs_to = "Entity",
|
||||
from = "Column::ParentId",
|
||||
|
|
@ -46,6 +48,12 @@ pub enum Relation {
|
|||
SameyUser,
|
||||
}
|
||||
|
||||
impl Related<super::samey_pool_post::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::SameyPoolPost.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl Related<super::samey_post_source::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::SameyPostSource.def()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue