From 238b4415606c75bf5a07d12d90612cb2d8f66527 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Sep 2024 02:46:31 +0200 Subject: [PATCH] [backend/database] Remove remote user reply notifications --- ...14004319_RemoveRemoteReplyNotifications.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240914004319_RemoveRemoteReplyNotifications.cs diff --git a/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240914004319_RemoveRemoteReplyNotifications.cs b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240914004319_RemoveRemoteReplyNotifications.cs new file mode 100644 index 00000000..4566467a --- /dev/null +++ b/Iceshrimp.Backend/Core/Database/Migrations/v2024.1-beta4/20240914004319_RemoveRemoteReplyNotifications.cs @@ -0,0 +1,27 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Infrastructure; + +#nullable disable + +namespace Iceshrimp.Backend.Core.Database.Migrations +{ + /// + [DbContext(typeof(DatabaseContext))] + [Migration("20240914004319_RemoveRemoteReplyNotifications")] + public partial class RemoveRemoteReplyNotifications : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql(""" + DELETE FROM "notification" WHERE "notifieeId" NOT IN (SELECT "id" FROM "user" WHERE "host" IS NULL); + """); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +}