relay_agent_entity/gen/
message.rs1use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
7#[sea_orm(table_name = "message")]
8pub struct Model {
9 #[sea_orm(primary_key, auto_increment = false)]
10 pub gid: Uuid,
11 pub inbox_id: Uuid,
12 pub envelope: Json,
13 pub created_at: DateTime,
14}
15
16#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
17pub enum Relation {
18 #[sea_orm(
19 belongs_to = "super::inbox::Entity",
20 from = "Column::InboxId",
21 to = "super::inbox::Column::Id",
22 on_update = "NoAction",
23 on_delete = "Cascade"
24 )]
25 Inbox,
26}
27
28impl Related<super::inbox::Entity> for Entity {
29 fn to() -> RelationDef {
30 Relation::Inbox.def()
31 }
32}
33
34impl ActiveModelBehavior for ActiveModel {}