mirror of
https://github.com/bitwarden/server.git
synced 2025-05-22 12:04:27 -05:00
create script with folder and fav json data
This commit is contained in:
parent
c7c5ae8f9a
commit
7c3735cb43
@ -14,6 +14,9 @@ AS
|
|||||||
BEGIN
|
BEGIN
|
||||||
SET NOCOUNT ON
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
DECLARE @UserIdKey VARCHAR(50) = CONCAT('"', @UserId, '"')
|
||||||
|
DECLARE @UserIdPath VARCHAR(50) = CONCAT('$.', @UserIdKey)
|
||||||
|
|
||||||
INSERT INTO [dbo].[Cipher]
|
INSERT INTO [dbo].[Cipher]
|
||||||
(
|
(
|
||||||
[Id],
|
[Id],
|
||||||
@ -33,8 +36,8 @@ BEGIN
|
|||||||
@OrganizationId,
|
@OrganizationId,
|
||||||
@Type,
|
@Type,
|
||||||
@Data,
|
@Data,
|
||||||
CASE WHEN @Favorite = 0 THEN NULL ELSE JSON_QUERY((SELECT @UserId u FOR JSON PATH)) END,
|
CASE WHEN @FolderId IS NOT NULL THEN CONCAT('{', @UserIdKey, ':"', @FolderId, '"', '}') ELSE NULL END,
|
||||||
CASE WHEN @FolderId IS NULL THEN NULL ELSE JSON_QUERY((SELECT @UserId u, @FolderId f FOR JSON PATH)) END,
|
CASE WHEN @Favorite = 1 THEN CONCAT('{', @UserIdKey, ':true}') ELSE NULL END,
|
||||||
@CreationDate,
|
@CreationDate,
|
||||||
@RevisionDate
|
@RevisionDate
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user