aboutsummaryrefslogtreecommitdiff
path: root/entity/src/access_to_queue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'entity/src/access_to_queue.rs')
-rw-r--r--entity/src/access_to_queue.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/entity/src/access_to_queue.rs b/entity/src/access_to_queue.rs
new file mode 100644
index 0000000..9de03d5
--- /dev/null
+++ b/entity/src/access_to_queue.rs
@@ -0,0 +1,46 @@
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 = "access_to_queue")]
7pub struct Model {
8 #[sea_orm(primary_key, auto_increment = false)]
9 pub user_id: i64,
10 #[sea_orm(primary_key, auto_increment = false)]
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 #[sea_orm(
25 belongs_to = "super::users::Entity",
26 from = "Column::UserId",
27 to = "super::users::Column::Id",
28 on_update = "Cascade",
29 on_delete = "Cascade"
30 )]
31 Users,
32}
33
34impl Related<super::queues::Entity> for Entity {
35 fn to() -> RelationDef {
36 Relation::Queues.def()
37 }
38}
39
40impl Related<super::users::Entity> for Entity {
41 fn to() -> RelationDef {
42 Relation::Users.def()
43 }
44}
45
46impl ActiveModelBehavior for ActiveModel {}