mirror of
https://github.com/bitwarden/server.git
synced 2025-05-23 12:31:06 -05:00
[Soft Delete] bulk import fails if DeletedDate null
This commit is contained in:
parent
45e1e1a01b
commit
145dcabba6
@ -629,7 +629,7 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
ciphersTable.Columns.Add(creationDateColumn);
|
ciphersTable.Columns.Add(creationDateColumn);
|
||||||
var revisionDateColumn = new DataColumn(nameof(c.RevisionDate), c.RevisionDate.GetType());
|
var revisionDateColumn = new DataColumn(nameof(c.RevisionDate), c.RevisionDate.GetType());
|
||||||
ciphersTable.Columns.Add(revisionDateColumn);
|
ciphersTable.Columns.Add(revisionDateColumn);
|
||||||
var deletedDateColumn = new DataColumn(nameof(c.DeletedDate), c.DeletedDate.GetType());
|
var deletedDateColumn = new DataColumn(nameof(c.DeletedDate), typeof(DateTime));
|
||||||
ciphersTable.Columns.Add(deletedDateColumn);
|
ciphersTable.Columns.Add(deletedDateColumn);
|
||||||
|
|
||||||
foreach (DataColumn col in ciphersTable.Columns)
|
foreach (DataColumn col in ciphersTable.Columns)
|
||||||
@ -655,7 +655,7 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
row[attachmentsColumn] = cipher.Attachments;
|
row[attachmentsColumn] = cipher.Attachments;
|
||||||
row[creationDateColumn] = cipher.CreationDate;
|
row[creationDateColumn] = cipher.CreationDate;
|
||||||
row[revisionDateColumn] = cipher.RevisionDate;
|
row[revisionDateColumn] = cipher.RevisionDate;
|
||||||
row[deletedDateColumn] = cipher.DeletedDate;
|
row[deletedDateColumn] = cipher.DeletedDate.HasValue ? (object)cipher.DeletedDate : DBNull.Value;
|
||||||
|
|
||||||
ciphersTable.Rows.Add(row);
|
ciphersTable.Rows.Add(row);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user