//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.14 use super::sea_orm_active_enums::QueueElementStatusEnum; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] #[sea_orm(table_name = "queue_elements")] pub struct Model { #[sea_orm(primary_key)] pub id: i64, pub queue_id: i64, pub user_id: i64, #[sea_orm(unique)] pub position: i64, pub status: QueueElementStatusEnum, } #[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, #[sea_orm( belongs_to = "super::users::Entity", from = "Column::UserId", to = "super::users::Column::Id", on_update = "Cascade", on_delete = "Cascade" )] Users, } impl Related for Entity { fn to() -> RelationDef { Relation::Queues.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Users.def() } } impl ActiveModelBehavior for ActiveModel {}