1
0
mirror of https://github.com/bitwarden/server synced 2026-01-03 09:03:44 +00:00

[PM-221] Adding CipherId to the Send table, create/update sprocs, and added mi… (#3646)

* Adding CipherId to the Send table, create/update sprocs, and added migrations

* changing migrator script to drop create sprocs

* fixing double brackets

* Revert "changing migrator script to drop create sprocs"

This reverts commit 2d5171e7e5.

* Remove comment I nitpicked

* Script best practices

* Fix typo

* Try recreate again

* Fix missing output

* Revert "Try recreate again"

This reverts commit 38257ebeaa.

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
Co-authored-by: federicom09 <fmonesiglio@bitwarden.com>
This commit is contained in:
Tom
2024-03-04 19:31:33 -05:00
committed by GitHub
parent 94d665e6e9
commit 997af0f6ab
14 changed files with 7265 additions and 6 deletions

View File

@@ -13,7 +13,8 @@
@ExpirationDate DATETIME2(7),
@DeletionDate DATETIME2(7),
@Disabled BIT,
@HideEmail BIT
@HideEmail BIT,
@CipherId UNIQUEIDENTIFIER = NULL
AS
BEGIN
SET NOCOUNT ON
@@ -34,7 +35,8 @@ BEGIN
[ExpirationDate],
[DeletionDate],
[Disabled],
[HideEmail]
[HideEmail],
[CipherId]
)
VALUES
(
@@ -52,7 +54,8 @@ BEGIN
@ExpirationDate,
@DeletionDate,
@Disabled,
@HideEmail
@HideEmail,
@CipherId
)
IF @UserId IS NOT NULL

View File

@@ -13,7 +13,8 @@
@ExpirationDate DATETIME2(7),
@DeletionDate DATETIME2(7),
@Disabled BIT,
@HideEmail BIT
@HideEmail BIT,
@CipherId UNIQUEIDENTIFIER = NULL
AS
BEGIN
SET NOCOUNT ON
@@ -34,7 +35,8 @@ BEGIN
[ExpirationDate] = @ExpirationDate,
[DeletionDate] = @DeletionDate,
[Disabled] = @Disabled,
[HideEmail] = @HideEmail
[HideEmail] = @HideEmail,
[CipherId] = @CipherId
WHERE
[Id] = @Id

View File

@@ -14,9 +14,11 @@
[DeletionDate] DATETIME2 (7) NOT NULL,
[Disabled] BIT NOT NULL,
[HideEmail] BIT NULL,
[CipherId] UNIQUEIDENTIFIER NULL,
CONSTRAINT [PK_Send] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Send_Organization] FOREIGN KEY ([OrganizationId]) REFERENCES [dbo].[Organization] ([Id]),
CONSTRAINT [FK_Send_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id])
CONSTRAINT [FK_Send_User] FOREIGN KEY ([UserId]) REFERENCES [dbo].[User] ([Id]),
CONSTRAINT [FK_Send_Cipher] FOREIGN KEY ([CipherId]) REFERENCES [dbo].[Cipher] ([Id])
);