diff options
Diffstat (limited to 'entity/src/access_to_queue.rs')
| -rw-r--r-- | entity/src/access_to_queue.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/entity/src/access_to_queue.rs b/entity/src/access_to_queue.rs index 9de03d5..5244ed0 100644 --- a/entity/src/access_to_queue.rs +++ b/entity/src/access_to_queue.rs | |||
| @@ -9,11 +9,20 @@ pub struct Model { | |||
| 9 | pub user_id: i64, | 9 | pub user_id: i64, |
| 10 | #[sea_orm(primary_key, auto_increment = false)] | 10 | #[sea_orm(primary_key, auto_increment = false)] |
| 11 | pub queue_id: i64, | 11 | pub queue_id: i64, |
| 12 | pub invite_token_id: i64, | ||
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | 15 | #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] |
| 15 | pub enum Relation { | 16 | pub enum Relation { |
| 16 | #[sea_orm( | 17 | #[sea_orm( |
| 18 | belongs_to = "super::invite_tokens::Entity", | ||
| 19 | from = "Column::InviteTokenId", | ||
| 20 | to = "super::invite_tokens::Column::Id", | ||
| 21 | on_update = "Cascade", | ||
| 22 | on_delete = "Cascade" | ||
| 23 | )] | ||
| 24 | InviteTokens, | ||
| 25 | #[sea_orm( | ||
| 17 | belongs_to = "super::queues::Entity", | 26 | belongs_to = "super::queues::Entity", |
| 18 | from = "Column::QueueId", | 27 | from = "Column::QueueId", |
| 19 | to = "super::queues::Column::Id", | 28 | to = "super::queues::Column::Id", |
| @@ -31,6 +40,12 @@ pub enum Relation { | |||
| 31 | Users, | 40 | Users, |
| 32 | } | 41 | } |
| 33 | 42 | ||
| 43 | impl Related<super::invite_tokens::Entity> for Entity { | ||
| 44 | fn to() -> RelationDef { | ||
| 45 | Relation::InviteTokens.def() | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 34 | impl Related<super::queues::Entity> for Entity { | 49 | impl Related<super::queues::Entity> for Entity { |
| 35 | fn to() -> RelationDef { | 50 | fn to() -> RelationDef { |
| 36 | Relation::Queues.def() | 51 | Relation::Queues.def() |
