[backend/database] Remove remote user reply notifications

This commit is contained in:
Laura Hausmann 2024-09-14 02:46:31 +02:00
parent 14f078d145
commit 238b441560
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Infrastructure;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
[DbContext(typeof(DatabaseContext))]
[Migration("20240914004319_RemoveRemoteReplyNotifications")]
public partial class RemoveRemoteReplyNotifications : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("""
DELETE FROM "notification" WHERE "notifieeId" NOT IN (SELECT "id" FROM "user" WHERE "host" IS NULL);
""");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}