mirror of
https://github.com/bitwarden/server
synced 2026-01-26 22:33:31 +00:00
local code review feedback
This commit is contained in:
@@ -453,7 +453,7 @@ public class CollectionRepository : Repository<Collection, Guid>, ICollectionRep
|
||||
.OrderBy(s => s.OrganizationUserId)
|
||||
.ToList();
|
||||
|
||||
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity & SqlBulkCopyOptions.CheckConstraints, transaction);
|
||||
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity | SqlBulkCopyOptions.CheckConstraints, transaction);
|
||||
bulkCopy.DestinationTableName = "[dbo].[DefaultCollectionSemaphore]";
|
||||
bulkCopy.BatchSize = 500;
|
||||
bulkCopy.BulkCopyTimeout = 120;
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
-- This migration is idempotent and can be run multiple times safely
|
||||
INSERT INTO [dbo].[DefaultCollectionSemaphore]
|
||||
(
|
||||
[OrganizationId],
|
||||
[OrganizationUserId],
|
||||
[CreationDate]
|
||||
)
|
||||
SELECT DISTINCT
|
||||
c.[OrganizationId],
|
||||
cu.[OrganizationUserId],
|
||||
c.[CreationDate]
|
||||
GETUTCDATE()
|
||||
FROM
|
||||
[dbo].[Collection] c
|
||||
INNER JOIN
|
||||
@@ -23,7 +21,6 @@ WHERE
|
||||
FROM
|
||||
[dbo].[DefaultCollectionSemaphore] dcs
|
||||
WHERE
|
||||
dcs.[OrganizationId] = c.[OrganizationId]
|
||||
AND dcs.[OrganizationUserId] = cu.[OrganizationUserId]
|
||||
dcs.[OrganizationUserId] = cu.[OrganizationUserId]
|
||||
);
|
||||
GO
|
||||
|
||||
Reference in New Issue
Block a user