mirror of
https://github.com/bitwarden/server.git
synced 2026-02-09 18:33:11 +08:00
* 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>
33 lines
1.3 KiB
Transact-SQL
33 lines
1.3 KiB
Transact-SQL
CREATE TABLE [dbo].[Send] (
|
|
[Id] UNIQUEIDENTIFIER NOT NULL,
|
|
[UserId] UNIQUEIDENTIFIER NULL,
|
|
[OrganizationId] UNIQUEIDENTIFIER NULL,
|
|
[Type] TINYINT NOT NULL,
|
|
[Data] VARCHAR(MAX) NOT NULL,
|
|
[Key] VARCHAR (MAX) NOT NULL,
|
|
[Password] NVARCHAR (300) NULL,
|
|
[MaxAccessCount] INT NULL,
|
|
[AccessCount] INT NOT NULL,
|
|
[CreationDate] DATETIME2 (7) NOT NULL,
|
|
[RevisionDate] DATETIME2 (7) NOT NULL,
|
|
[ExpirationDate] DATETIME2 (7) NULL,
|
|
[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_Cipher] FOREIGN KEY ([CipherId]) REFERENCES [dbo].[Cipher] ([Id])
|
|
);
|
|
|
|
|
|
GO
|
|
CREATE NONCLUSTERED INDEX [IX_Send_UserId_OrganizationId]
|
|
ON [dbo].[Send]([UserId] ASC, [OrganizationId] ASC);
|
|
|
|
GO
|
|
CREATE NONCLUSTERED INDEX [IX_Send_DeletionDate]
|
|
ON [dbo].[Send]([DeletionDate] ASC);
|
|
|