aboutsummaryrefslogtreecommitdiff
path: root/entity/src/invite_tokens.rs
diff options
context:
space:
mode:
Diffstat (limited to 'entity/src/invite_tokens.rs')
-rw-r--r--entity/src/invite_tokens.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/entity/src/invite_tokens.rs b/entity/src/invite_tokens.rs
index f239567..c0b59f7 100644
--- a/entity/src/invite_tokens.rs
+++ b/entity/src/invite_tokens.rs
@@ -9,10 +9,14 @@ pub struct Model {
9 pub id: i64, 9 pub id: i64,
10 pub token: Uuid, 10 pub token: Uuid,
11 pub queue_id: i64, 11 pub queue_id: i64,
12 pub name: String,
13 pub is_revoked: bool,
12} 14}
13 15
14#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] 16#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15pub enum Relation { 17pub enum Relation {
18 #[sea_orm(has_many = "super::access_to_queue::Entity")]
19 AccessToQueue,
16 #[sea_orm( 20 #[sea_orm(
17 belongs_to = "super::queues::Entity", 21 belongs_to = "super::queues::Entity",
18 from = "Column::QueueId", 22 from = "Column::QueueId",
@@ -23,6 +27,12 @@ pub enum Relation {
23 Queues, 27 Queues,
24} 28}
25 29
30impl Related<super::access_to_queue::Entity> for Entity {
31 fn to() -> RelationDef {
32 Relation::AccessToQueue.def()
33 }
34}
35
26impl Related<super::queues::Entity> for Entity { 36impl Related<super::queues::Entity> for Entity {
27 fn to() -> RelationDef { 37 fn to() -> RelationDef {
28 Relation::Queues.def() 38 Relation::Queues.def()