1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-29 23:01:46 +01:00

Merge pull request #696 from bitwarden/soft-delete-sql-cleanup

[Soft Delete] deleted date null failure in DataTable
This commit is contained in:
Chad Scharf 2020-04-10 15:25:37 -04:00 committed by GitHub
commit eeba92b46f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -629,7 +629,7 @@ namespace Bit.Core.Repositories.SqlServer
ciphersTable.Columns.Add(creationDateColumn);
var revisionDateColumn = new DataColumn(nameof(c.RevisionDate), c.RevisionDate.GetType());
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);
foreach (DataColumn col in ciphersTable.Columns)
@ -655,7 +655,7 @@ namespace Bit.Core.Repositories.SqlServer
row[attachmentsColumn] = cipher.Attachments;
row[creationDateColumn] = cipher.CreationDate;
row[revisionDateColumn] = cipher.RevisionDate;
row[deletedDateColumn] = cipher.DeletedDate;
row[deletedDateColumn] = cipher.DeletedDate.HasValue ? (object)cipher.DeletedDate : DBNull.Value;
ciphersTable.Rows.Add(row);
}