main
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "user_followers")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "follow_pair")]
pub follower_id: i64,
#[sea_orm(
belongs_to,
from = "follower_id",
to = "uid",
relation_enum = "Follower"
)]
pub follower: BelongsTo<super::user::Entity>,
#[sea_orm(unique_key = "follow_pair")]
pub followed_id: i64,
#[sea_orm(
belongs_to,
from = "followed_id",
to = "uid",
relation_enum = "Followed"
)]
pub followed: BelongsTo<super::user::Entity>,
pub created_at: OffsetDateTime,
}
impl ActiveModelBehavior for ActiveModel {}