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 commit2d5171e7e5. * Remove comment I nitpicked * Script best practices * Fix typo * Try recreate again * Fix missing output * Revert "Try recreate again" This reverts commit38257ebeaa. --------- Co-authored-by: Matt Bishop <mbishop@bitwarden.com> Co-authored-by: federicom09 <fmonesiglio@bitwarden.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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])
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user