diff --git a/back/src/Kyoo.Postgresql/PostgresContext.cs b/back/src/Kyoo.Postgresql/PostgresContext.cs index f7fbeb8f..009f9edc 100644 --- a/back/src/Kyoo.Postgresql/PostgresContext.cs +++ b/back/src/Kyoo.Postgresql/PostgresContext.cs @@ -132,7 +132,7 @@ namespace Kyoo.Postgresql /// protected override bool IsDuplicateException(Exception ex) { - return ex.InnerException is PostgresException { SqlState: PostgresErrorCodes.UniqueViolation }; + return ex.InnerException is PostgresException { SqlState: PostgresErrorCodes.UniqueViolation or PostgresErrorCodes.ForeignKeyViolation }; } } }