🗃️ 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

View File

@ -27,7 +27,7 @@ public enum NotificationPushProvider
Google
}
[Index(nameof(DeviceToken), nameof(DeviceId), IsUnique = true)]
[Index(nameof(DeviceToken), nameof(DeviceId), nameof(AccountId), IsUnique = true)]
public class NotificationPushSubscription : ModelBase
{
public Guid Id { get; set; } = Guid.NewGuid();

View File

@ -36,7 +36,6 @@ public class NotificationService(
// Reset these audit fields to renew the lifecycle of this device token
existingSubscription.DeviceId = deviceId;
existingSubscription.DeviceToken = deviceToken;
existingSubscription.UpdatedAt = SystemClock.Instance.GetCurrentInstant();
db.Update(existingSubscription);
await db.SaveChangesAsync();
return existingSubscription;