//! `SeaORM` Entity. use sea_orm::entity::prelude::*; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "role_user")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub role_id: Uuid, #[sea_orm(primary_key, auto_increment = false)] pub user_id: Uuid, #[sea_orm( belongs_to, from = "role_id", to = "id", on_update = "NoAction", on_delete = "Cascade" )] pub role: HasOne, #[sea_orm( belongs_to, from = "user_id", to = "id", on_update = "NoAction", on_delete = "Cascade" )] pub user: HasOne, } impl ActiveModelBehavior for ActiveModel {}