From 29bd29a71e0a9d2683eb53452eec766a69388459 Mon Sep 17 00:00:00 2001 From: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com> Date: Fri, 3 May 2024 19:30:24 +0200 Subject: [PATCH] Fix #2980 - Add cascade delete to foreign keys (#2982) --- .../PortalDbContext.cs | 14 +- ... cascade when deleting devices.Designer.cs | 606 +++++++++++++++++ ...values in cascade when deleting devices.cs | 67 ++ .../PortalDbContextModelSnapshot.cs | 8 +- ... cascade when deleting devices.Designer.cs | 611 ++++++++++++++++++ ...values in cascade when deleting devices.cs | 67 ++ .../PortalDbContextModelSnapshot.cs | 8 +- 7 files changed, 1372 insertions(+), 9 deletions(-) create mode 100644 src/IoTHub.Portal.MySql/Migrations/20240503170430_Fix #2980 - delete tag values in cascade when deleting devices.Designer.cs create mode 100644 src/IoTHub.Portal.MySql/Migrations/20240503170430_Fix #2980 - delete tag values in cascade when deleting devices.cs create mode 100644 src/IoTHub.Portal.Postgres/Migrations/20240503170119_Fix #2980 - delete tag values in cascade when deleting devices.Designer.cs create mode 100644 src/IoTHub.Portal.Postgres/Migrations/20240503170119_Fix #2980 - delete tag values in cascade when deleting devices.cs diff --git a/src/IoTHub.Portal.Infrastructure/PortalDbContext.cs b/src/IoTHub.Portal.Infrastructure/PortalDbContext.cs index 088797ff2..13b3593c6 100644 --- a/src/IoTHub.Portal.Infrastructure/PortalDbContext.cs +++ b/src/IoTHub.Portal.Infrastructure/PortalDbContext.cs @@ -25,10 +25,8 @@ public class PortalDbContext : DbContext, IDataProtectionKeyContext public DbSet