1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 00:52:49 -05:00

[AC-1682] Change JOIN to INNER JOIN in SQL scripts

This commit is contained in:
Rui Tome
2023-12-06 15:58:21 +00:00
parent 0475b93b4e
commit 3e7e3a0928
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ WHERE C.[OrganizationId] = TG.[OrganizationId];
INSERT INTO [dbo].[CollectionGroup] ([CollectionId], [GroupId], [ReadOnly], [HidePasswords], [Manage]) INSERT INTO [dbo].[CollectionGroup] ([CollectionId], [GroupId], [ReadOnly], [HidePasswords], [Manage])
SELECT C.[Id], TG.[GroupId], 0, 0, 0 SELECT C.[Id], TG.[GroupId], 0, 0, 0
FROM [dbo].[Collection] C FROM [dbo].[Collection] C
JOIN #TempGroup TG ON C.[OrganizationId] = TG.[OrganizationId] INNER JOIN #TempGroup TG ON C.[OrganizationId] = TG.[OrganizationId]
LEFT JOIN [dbo].[CollectionGroup] CG ON CG.[CollectionId] = C.[Id] AND CG.[GroupId] = TG.[GroupId] LEFT JOIN [dbo].[CollectionGroup] CG ON CG.[CollectionId] = C.[Id] AND CG.[GroupId] = TG.[GroupId]
WHERE CG.[CollectionId] IS NULL; WHERE CG.[CollectionId] IS NULL;

View File

@ -18,10 +18,10 @@ BEGIN
target.[HidePasswords] = 0, target.[HidePasswords] = 0,
target.[Manage] = 0 target.[Manage] = 0
FROM [dbo].[CollectionUser] AS target FROM [dbo].[CollectionUser] AS target
JOIN ( INNER JOIN (
SELECT C.[Id] AS [CollectionId], T.[OrganizationUserId] SELECT C.[Id] AS [CollectionId], T.[OrganizationUserId]
FROM [dbo].[Collection] C FROM [dbo].[Collection] C
JOIN #TempOrgUser T ON C.[OrganizationId] = T.[OrganizationId] AND T.Batch = @CurrentBatch INNER JOIN #TempOrgUser T ON C.[OrganizationId] = T.[OrganizationId] AND T.Batch = @CurrentBatch
) AS source ) AS source
ON target.[CollectionId] = source.[CollectionId] AND target.[OrganizationUserId] = source.[OrganizationUserId]; ON target.[CollectionId] = source.[CollectionId] AND target.[OrganizationUserId] = source.[OrganizationUserId];
@ -31,7 +31,7 @@ BEGIN
FROM ( FROM (
SELECT C.[Id] AS [CollectionId], T.[OrganizationUserId] SELECT C.[Id] AS [CollectionId], T.[OrganizationUserId]
FROM [dbo].[Collection] C FROM [dbo].[Collection] C
JOIN #TempOrgUser T ON C.[OrganizationId] = T.[OrganizationId] AND T.Batch = @CurrentBatch INNER JOIN #TempOrgUser T ON C.[OrganizationId] = T.[OrganizationId] AND T.Batch = @CurrentBatch
) AS source ) AS source
LEFT JOIN [dbo].[CollectionUser] AS target LEFT JOIN [dbo].[CollectionUser] AS target
ON target.[CollectionId] = source.[CollectionId] AND target.[OrganizationUserId] = source.[OrganizationUserId] ON target.[CollectionId] = source.[CollectionId] AND target.[OrganizationUserId] = source.[OrganizationUserId]