1
0
mirror of https://github.com/bitwarden/server synced 2026-01-26 06:13:31 +00:00

Make sqlbulkcopy check constraints

This commit is contained in:
Thomas Rittson
2025-12-30 14:48:49 +10:00
parent f069fafea1
commit a91f0967f4

View File

@@ -502,7 +502,7 @@ public class CollectionRepository : Repository<Collection, Guid>, ICollectionRep
.ThenBy(s => s.OrganizationUserId)
.ToList();
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity, transaction);
using var bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.KeepIdentity & SqlBulkCopyOptions.CheckConstraints, transaction);
bulkCopy.DestinationTableName = "[dbo].[DefaultCollectionSemaphore]";
bulkCopy.BatchSize = 500;
bulkCopy.BulkCopyTimeout = 120;