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_blocks")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, #[sea_orm(unique_key = "block_pair")] pub blocker_id: i64, #[sea_orm(belongs_to, from = "blocker_id", to = "uid", relation_enum = "Blocker")] pub blocker: BelongsTo, #[sea_orm(unique_key = "block_pair")] pub blocked_id: i64, #[sea_orm(belongs_to, from = "blocked_id", to = "uid", relation_enum = "Blocked")] pub blocked: BelongsTo, pub created_at: OffsetDateTime, } impl ActiveModelBehavior for ActiveModel {}