🗃️ Fix notification push subscription unique key

This commit is contained in:
2025-06-03 00:30:23 +08:00
parent b25b08b5c5
commit 09e4150294
4 changed files with 3433 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class FixPushNotificationIndex : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "ix_notification_push_subscriptions_device_token_device_id",
table: "notification_push_subscriptions");
migrationBuilder.CreateIndex(
name: "ix_notification_push_subscriptions_device_token_device_id_acco",
table: "notification_push_subscriptions",
columns: new[] { "device_token", "device_id", "account_id" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "ix_notification_push_subscriptions_device_token_device_id_acco",
table: "notification_push_subscriptions");
migrationBuilder.CreateIndex(
name: "ix_notification_push_subscriptions_device_token_device_id",
table: "notification_push_subscriptions",
columns: new[] { "device_token", "device_id" },
unique: true);
}
}
}