mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 10:59:17 +01:00
Add user follow relation
This commit is contained in:
parent
9acf6578bf
commit
468371d43d
5 changed files with 108 additions and 0 deletions
38
src/entities/follow_relation.rs
Normal file
38
src/entities/follow_relation.rs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.10
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
||||
#[sea_orm(table_name = "follow_relation")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i32,
|
||||
pub followee_id: String,
|
||||
pub follower_id: String,
|
||||
pub followee_host: Option<String>,
|
||||
pub follower_host: Option<String>,
|
||||
pub followee_inbox: Option<String>,
|
||||
pub follower_inbox: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::user::Entity",
|
||||
from = "Column::FollowerId",
|
||||
to = "super::user::Column::Id",
|
||||
on_update = "NoAction",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
User2,
|
||||
#[sea_orm(
|
||||
belongs_to = "super::user::Entity",
|
||||
from = "Column::FolloweeId",
|
||||
to = "super::user::Column::Id",
|
||||
on_update = "NoAction",
|
||||
on_delete = "Cascade"
|
||||
)]
|
||||
User1,
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
|
@ -4,3 +4,4 @@ pub mod prelude;
|
|||
|
||||
pub mod post;
|
||||
pub mod user;
|
||||
pub mod follow_relation;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.10
|
||||
|
||||
pub use super::follow_relation::Entity as FollowRelation;
|
||||
pub use super::post::Entity as Post;
|
||||
pub use super::user::Entity as User;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue