use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "post_reactions")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub post_id: Uuid,
pub user_id: Uuid,
pub reaction_id: Uuid,
pub created_at: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(belongs_to = "super::posts::Entity", from = "Column::PostId", to = "super::posts::Column::Id", on_update = "Cascade", on_delete = "Cascade")]
Posts,
#[sea_orm(belongs_to = "super::reaction_types::Entity", from = "Column::ReactionId", to = "super::reaction_types::Column::Id", on_update = "Cascade", on_delete = "Cascade")]
ReactionTypes,
}
impl ActiveModelBehavior for ActiveModel {}
neiam
/recourse
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
889 B · text
History
263b40b