mirror of
https://github.com/bitwarden/server
synced 2025-12-27 05:33:17 +00:00
[PM-22974] Cascade delete NotificationStatus entities (#6011)
* cascade delete NotificationStatus entities * add userId to test for foreign constraint * add missing properties for Notification * add check for foreign key
This commit is contained in:
@@ -5,11 +5,10 @@ CREATE TABLE [dbo].[NotificationStatus]
|
||||
[ReadDate] DATETIME2 (7) NULL,
|
||||
[DeletedDate] DATETIME2 (7) NULL,
|
||||
CONSTRAINT [PK_NotificationStatus] PRIMARY KEY CLUSTERED ([NotificationId] ASC, [UserId] ASC),
|
||||
CONSTRAINT [FK_NotificationStatus_Notification] FOREIGN KEY ([NotificationId]) REFERENCES [dbo].[Notification] ([Id]),
|
||||
CONSTRAINT [FK_NotificationStatus_Notification] FOREIGN KEY ([NotificationId]) REFERENCES [dbo].[Notification] ([Id]) ON DELETE CASCADE,
|
||||
CONSTRAINT [FK_NotificationStatus_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])
|
||||
);
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_NotificationStatus_UserId]
|
||||
ON [dbo].[NotificationStatus]([UserId] ASC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user