mirror of
https://github.com/bitwarden/server.git
synced 2025-07-17 23:50:58 -05:00
dep. history and favorites apis. backwards compat
This commit is contained in:
@ -68,7 +68,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Build Include="dbo\Tables\Device.sql" />
|
||||
<Build Include="dbo\Tables\History.sql" />
|
||||
<Build Include="dbo\Tables\Cipher.sql" />
|
||||
<Build Include="dbo\Tables\FolderCipher.sql" />
|
||||
<Build Include="dbo\Tables\Grant.sql" />
|
||||
@ -85,7 +84,6 @@
|
||||
<Build Include="dbo\Tables\SubvaultUser.sql" />
|
||||
<Build Include="dbo\Views\SubvaultUserView.sql" />
|
||||
<Build Include="dbo\Views\DeviceView.sql" />
|
||||
<Build Include="dbo\Views\HistoryView.sql" />
|
||||
<Build Include="dbo\Views\FolderView.sql" />
|
||||
<Build Include="dbo\Views\CipherView.sql" />
|
||||
<Build Include="dbo\Views\OrganizationUserView.sql" />
|
||||
@ -123,7 +121,6 @@
|
||||
<Build Include="dbo\Stored Procedures\Device_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Organization_DeleteById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Device_ReadByIdentifierUserId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByRevisionDateUserWithDeleteHistory.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Organization_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Device_ReadByUserId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByTypeUserId.sql" />
|
||||
@ -131,7 +128,6 @@
|
||||
<Build Include="dbo\Stored Procedures\Device_Update.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\OrganizationUser_Create.sql" />
|
||||
<Build Include="dbo\Stored Procedures\History_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\CipherDetails_ReadByUserIdHasSubvault.sql" />
|
||||
<Build Include="dbo\Stored Procedures\OrganizationUser_DeleteById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\User_Create.sql" />
|
||||
|
@ -1,24 +0,0 @@
|
||||
CREATE PROCEDURE [dbo].[CipherDetails_ReadByRevisionDateUserWithDeleteHistory]
|
||||
@SinceRevisionDate DATETIME2(7),
|
||||
@UserId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[CipherDetails](@UserId) C
|
||||
WHERE
|
||||
[RevisionDate] > @SinceRevisionDate
|
||||
AND [UserId] = @UserId
|
||||
|
||||
SELECT
|
||||
[CipherId]
|
||||
FROM
|
||||
[dbo].[History]
|
||||
WHERE
|
||||
[Date] > @SinceRevisionDate
|
||||
AND [Event] = 2 -- Only cipher delete events.
|
||||
AND [UserId] = @UserId
|
||||
END
|
@ -1,13 +0,0 @@
|
||||
CREATE PROCEDURE [dbo].[History_ReadById]
|
||||
@Id BIGINT
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[HistoryView]
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
END
|
@ -26,21 +26,6 @@ BEGIN
|
||||
|
||||
SET NOCOUNT ON
|
||||
|
||||
INSERT INTO [dbo].[History]
|
||||
(
|
||||
[UserId],
|
||||
[CipherId],
|
||||
[Event],
|
||||
[Date]
|
||||
)
|
||||
SELECT
|
||||
[UserId],
|
||||
[Id],
|
||||
0, --Insert
|
||||
[CreationDate]
|
||||
FROM
|
||||
INSERTED
|
||||
|
||||
DECLARE @UserId UNIQUEIDENTIFIER = (SELECT TOP 1 [UserId] FROM INSERTED)
|
||||
|
||||
UPDATE
|
||||
@ -61,21 +46,6 @@ BEGIN
|
||||
|
||||
SET NOCOUNT ON
|
||||
|
||||
INSERT INTO [dbo].[History]
|
||||
(
|
||||
[UserId],
|
||||
[CipherId],
|
||||
[Event],
|
||||
[Date]
|
||||
)
|
||||
SELECT
|
||||
[UserId],
|
||||
[Id],
|
||||
1, --Update
|
||||
[RevisionDate]
|
||||
FROM
|
||||
INSERTED
|
||||
|
||||
DECLARE @UserId UNIQUEIDENTIFIER = (SELECT TOP 1 [UserId] FROM INSERTED)
|
||||
|
||||
UPDATE
|
||||
@ -96,21 +66,6 @@ BEGIN
|
||||
|
||||
SET NOCOUNT ON
|
||||
|
||||
INSERT INTO [dbo].[History]
|
||||
(
|
||||
[UserId],
|
||||
[CipherId],
|
||||
[Event],
|
||||
[Date]
|
||||
)
|
||||
SELECT
|
||||
[UserId],
|
||||
[Id],
|
||||
2, --Delete
|
||||
GETUTCDATE()
|
||||
FROM
|
||||
DELETED
|
||||
|
||||
DECLARE @UserId UNIQUEIDENTIFIER = (SELECT TOP 1 [UserId] FROM DELETED)
|
||||
|
||||
UPDATE
|
||||
|
@ -1,9 +0,0 @@
|
||||
CREATE TABLE [dbo].[History] (
|
||||
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
|
||||
[UserId] UNIQUEIDENTIFIER NULL,
|
||||
[CipherId] UNIQUEIDENTIFIER NOT NULL,
|
||||
[Event] TINYINT NOT NULL,
|
||||
[Date] DATETIME2 (7) NOT NULL,
|
||||
CONSTRAINT [PK_CipherHistory] PRIMARY KEY CLUSTERED ([Id] ASC)
|
||||
);
|
||||
|
@ -1,6 +0,0 @@
|
||||
CREATE VIEW [dbo].[HistoryView]
|
||||
AS
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[History]
|
Reference in New Issue
Block a user