Skip to content

Commit

Permalink
fixed #1152
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Dec 7, 2024
1 parent 41d3158 commit de0bc16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions warpgate-db-entities/src/User.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use poem_openapi::Object;
use sea_orm::entity::prelude::*;
use sea_orm::sea_query::ForeignKeyAction;
use sea_orm::Set;
use serde::Serialize;
use uuid::Uuid;
Expand Down Expand Up @@ -66,18 +67,22 @@ impl RelationTrait for Relation {
Self::OtpCredentials => Entity::has_many(super::OtpCredential::Entity)
.from(Column::Id)
.to(super::OtpCredential::Column::UserId)
.on_delete(ForeignKeyAction::Cascade)
.into(),
Self::PasswordCredentials => Entity::has_many(super::PasswordCredential::Entity)
.from(Column::Id)
.to(super::PasswordCredential::Column::UserId)
.on_delete(ForeignKeyAction::Cascade)
.into(),
Self::PublicKeyCredentials => Entity::has_many(super::PublicKeyCredential::Entity)
.from(Column::Id)
.to(super::PublicKeyCredential::Column::UserId)
.on_delete(ForeignKeyAction::Cascade)
.into(),
Self::SsoCredentials => Entity::has_many(super::SsoCredential::Entity)
.from(Column::Id)
.to(super::SsoCredential::Column::UserId)
.on_delete(ForeignKeyAction::Cascade)
.into(),
}
}
Expand Down

0 comments on commit de0bc16

Please sign in to comment.