use crate::common::watch_mode::WatchMode; use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "post_watch")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub post_id: Uuid, pub user_id: Uuid, pub mode: WatchMode, pub created_at: OffsetDateTime, pub updated_at: Option, #[sea_orm(belongs_to, from = "post_id", to = "id")] pub post: BelongsTo, #[sea_orm(belongs_to, from = "user_id", to = "uid")] pub user: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}