aboutsummaryrefslogtreecommitdiff
path: root/entity/src/invite_tokens.rs
diff options
context:
space:
mode:
authorTolmachev Igor <me@igorek.dev>2025-09-27 00:03:28 +0300
committerTolmachev Igor <me@igorek.dev>2025-09-27 00:03:28 +0300
commit974c8c586e1182d502a2c30ba8b622c0b4033937 (patch)
tree7f7a7df8650d344b729edda836be0f47f3ce0d17 /entity/src/invite_tokens.rs
parentf4c9192b9cc2f08c38822ed477a48dd7599238d6 (diff)
downloadqueue_server-974c8c586e1182d502a2c30ba8b622c0b4033937.tar.gz
queue_server-974c8c586e1182d502a2c30ba8b622c0b4033937.zip
Add invite tokens models
Diffstat (limited to 'entity/src/invite_tokens.rs')
-rw-r--r--entity/src/invite_tokens.rs32
1 files changed, 32 insertions, 0 deletions
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 @@
1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.14
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "invite_tokens")]
7pub struct Model {
8 #[sea_orm(primary_key)]
9 pub id: i64,
10 pub token: Uuid,
11 pub queue_id: i64,
12}
13
14#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15pub enum Relation {
16 #[sea_orm(
17 belongs_to = "super::queues::Entity",
18 from = "Column::QueueId",
19 to = "super::queues::Column::Id",
20 on_update = "Cascade",
21 on_delete = "Cascade"
22 )]
23 Queues,
24}
25
26impl Related<super::queues::Entity> for Entity {
27 fn to() -> RelationDef {
28 Relation::Queues.def()
29 }
30}
31
32impl ActiveModelBehavior for ActiveModel {}