Skip to content

Commit 2bf8487

Browse files
committed
local code review feedback
1 parent 38bab44 commit 2bf8487

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Infrastructure.Dapper/Repositories/CollectionRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ private async Task BulkInsertDefaultCollectionSemaphoresAsync(SqlConnection conn
453453
.OrderBy(s => s.OrganizationUserId)
454454
.ToList();
455455

456-
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity & SqlBulkCopyOptions.CheckConstraints, transaction);
456+
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity | SqlBulkCopyOptions.CheckConstraints, transaction);
457457
bulkCopy.DestinationTableName = "[dbo].[DefaultCollectionSemaphore]";
458458
bulkCopy.BatchSize = 500;
459459
bulkCopy.BulkCopyTimeout = 120;

util/Migrator/DbScripts/2025-12-30_02_PopulateDefaultCollectionSemaphore.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
-- This migration is idempotent and can be run multiple times safely
33
INSERT INTO [dbo].[DefaultCollectionSemaphore]
44
(
5-
[OrganizationId],
65
[OrganizationUserId],
76
[CreationDate]
87
)
98
SELECT DISTINCT
10-
c.[OrganizationId],
119
cu.[OrganizationUserId],
12-
c.[CreationDate]
10+
GETUTCDATE()
1311
FROM
1412
[dbo].[Collection] c
1513
INNER JOIN
@@ -23,7 +21,6 @@ WHERE
2321
FROM
2422
[dbo].[DefaultCollectionSemaphore] dcs
2523
WHERE
26-
dcs.[OrganizationId] = c.[OrganizationId]
27-
AND dcs.[OrganizationUserId] = cu.[OrganizationUserId]
24+
dcs.[OrganizationUserId] = cu.[OrganizationUserId]
2825
);
2926
GO

0 commit comments

Comments
 (0)