1
0
mirror of https://github.com/bitwarden/server synced 2025-12-10 05:13:48 +00:00
Files
server/src/Sql/NotificationCenter/dbo/Tables/NotificationStatus.sql
Maciej Zieniuk 8a515a3f2b PM-10560: Adding Cascades back to Notification Center (#4769)
* PM-10560: Adding Cascades back

* PM-10560: Add missing Notification FK with CASCADE

* PM-10560: Delete Notification cascades fix

* PM-10560: Further cascades removal, simplifications

* PM-10560: Cleanup

* PM-10560: Cleanup

* PM-10560: Sql migrations fix

* PM-10560: EF revert
2024-09-20 14:20:15 +02:00

16 lines
637 B
Transact-SQL

CREATE TABLE [dbo].[NotificationStatus]
(
[NotificationId] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[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_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])
);
GO
CREATE NONCLUSTERED INDEX [IX_NotificationStatus_UserId]
ON [dbo].[NotificationStatus]([UserId] ASC);