From 974c8c586e1182d502a2c30ba8b622c0b4033937 Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Sat, 27 Sep 2025 00:03:28 +0300 Subject: Add invite tokens models --- entity/src/invite_tokens.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 entity/src/invite_tokens.rs (limited to 'entity/src/invite_tokens.rs') diff --git a/entity/src/invite_tokens.rs b/entity/src/invite_tokens.rs new file mode 100644 index 0000000..f239567 --- /dev/null +++ b/entity/src/invite_tokens.rs @@ -0,0 +1,32 @@ +//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.14 + +use sea_orm::entity::prelude::*; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] +#[sea_orm(table_name = "invite_tokens")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i64, + pub token: Uuid, + pub queue_id: i64, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::queues::Entity", + from = "Column::QueueId", + to = "super::queues::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Queues, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Queues.def() + } +} + +impl ActiveModelBehavior for ActiveModel {} -- cgit v1.2.3