1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 12:43:14 +00:00

Added RevisionDate to User table/domain

This commit is contained in:
Kyle Spearrin
2016-02-21 00:36:08 -05:00
parent 1b3acec905
commit 5d7a0216bf
7 changed files with 26 additions and 14 deletions

View File

@@ -41,6 +41,7 @@ namespace Bit.Core.Repositories.SqlServer
cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = user.Email;
cmd.Parameters.Add("@MasterPassword", SqlDbType.NVarChar).Value = user.MasterPassword;
cmd.Parameters.Add("@SecurityStamp", SqlDbType.NVarChar).Value = user.SecurityStamp;
cmd.Parameters.Add("@RevisionDate", SqlDbType.DateTime2).Value = user.RevisionDate;
cmd.ExecuteNonQuery();
}
@@ -92,9 +93,9 @@ namespace Bit.Core.Repositories.SqlServer
UPDATE
[dbo].[Folder]
SET
[UserId] = TF.[UserId],
-- Do not update [UserId]
[Name] = TF.[Name],
[CreationDate] = TF.[CreationDate],
-- Do not update TF.[CreationDate]
[RevisionDate] = TF.[RevisionDate]
FROM
[dbo].[Folder] F
@@ -106,14 +107,14 @@ namespace Bit.Core.Repositories.SqlServer
UPDATE
[dbo].[Site]
SET
[UserId] = TS.[UserId],
[FolderId] = TS.[FolderId],
-- Do not update [UserId]
-- Do not update [FolderId]
[Name] = TS.[Name],
[Uri] = TS.[Uri],
[Username] = TS.[Username],
[Password] = TS.[Password],
[Notes] = TS.[Notes],
[CreationDate] = TS.[CreationDate],
-- Do not update [CreationDate]
[RevisionDate] = TS.[RevisionDate]
FROM
[dbo].[Site] S

View File

@@ -21,6 +21,7 @@ namespace Bit.Core.Repositories.SqlServer.Models
TwoFactorProvider = user.TwoFactorProvider;
AuthenticatorKey = user.AuthenticatorKey;
CreationDate = user.CreationDate;
RevisionDate = user.RevisionDate;
}
public Guid Id { get; set; }
@@ -34,6 +35,7 @@ namespace Bit.Core.Repositories.SqlServer.Models
public TwoFactorProvider? TwoFactorProvider { get; set; }
public string AuthenticatorKey { get; set; }
public DateTime CreationDate { get; set; }
public DateTime RevisionDate { get; set; }
public User ToDomain()
{
@@ -49,7 +51,8 @@ namespace Bit.Core.Repositories.SqlServer.Models
TwoFactorEnabled = TwoFactorEnabled,
TwoFactorProvider = TwoFactorProvider,
AuthenticatorKey = AuthenticatorKey,
CreationDate = CreationDate
CreationDate = CreationDate,
RevisionDate = RevisionDate
};
}
}