mirror of
https://github.com/bitwarden/server.git
synced 2025-02-08 00:31:27 +01:00
Added RevisionDate to User table/domain
This commit is contained in:
parent
1b3acec905
commit
5d7a0216bf
@ -41,6 +41,7 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = user.Email;
|
cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = user.Email;
|
||||||
cmd.Parameters.Add("@MasterPassword", SqlDbType.NVarChar).Value = user.MasterPassword;
|
cmd.Parameters.Add("@MasterPassword", SqlDbType.NVarChar).Value = user.MasterPassword;
|
||||||
cmd.Parameters.Add("@SecurityStamp", SqlDbType.NVarChar).Value = user.SecurityStamp;
|
cmd.Parameters.Add("@SecurityStamp", SqlDbType.NVarChar).Value = user.SecurityStamp;
|
||||||
|
cmd.Parameters.Add("@RevisionDate", SqlDbType.DateTime2).Value = user.RevisionDate;
|
||||||
cmd.ExecuteNonQuery();
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,9 +93,9 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
UPDATE
|
UPDATE
|
||||||
[dbo].[Folder]
|
[dbo].[Folder]
|
||||||
SET
|
SET
|
||||||
[UserId] = TF.[UserId],
|
-- Do not update [UserId]
|
||||||
[Name] = TF.[Name],
|
[Name] = TF.[Name],
|
||||||
[CreationDate] = TF.[CreationDate],
|
-- Do not update TF.[CreationDate]
|
||||||
[RevisionDate] = TF.[RevisionDate]
|
[RevisionDate] = TF.[RevisionDate]
|
||||||
FROM
|
FROM
|
||||||
[dbo].[Folder] F
|
[dbo].[Folder] F
|
||||||
@ -106,14 +107,14 @@ namespace Bit.Core.Repositories.SqlServer
|
|||||||
UPDATE
|
UPDATE
|
||||||
[dbo].[Site]
|
[dbo].[Site]
|
||||||
SET
|
SET
|
||||||
[UserId] = TS.[UserId],
|
-- Do not update [UserId]
|
||||||
[FolderId] = TS.[FolderId],
|
-- Do not update [FolderId]
|
||||||
[Name] = TS.[Name],
|
[Name] = TS.[Name],
|
||||||
[Uri] = TS.[Uri],
|
[Uri] = TS.[Uri],
|
||||||
[Username] = TS.[Username],
|
[Username] = TS.[Username],
|
||||||
[Password] = TS.[Password],
|
[Password] = TS.[Password],
|
||||||
[Notes] = TS.[Notes],
|
[Notes] = TS.[Notes],
|
||||||
[CreationDate] = TS.[CreationDate],
|
-- Do not update [CreationDate]
|
||||||
[RevisionDate] = TS.[RevisionDate]
|
[RevisionDate] = TS.[RevisionDate]
|
||||||
FROM
|
FROM
|
||||||
[dbo].[Site] S
|
[dbo].[Site] S
|
||||||
|
@ -21,6 +21,7 @@ namespace Bit.Core.Repositories.SqlServer.Models
|
|||||||
TwoFactorProvider = user.TwoFactorProvider;
|
TwoFactorProvider = user.TwoFactorProvider;
|
||||||
AuthenticatorKey = user.AuthenticatorKey;
|
AuthenticatorKey = user.AuthenticatorKey;
|
||||||
CreationDate = user.CreationDate;
|
CreationDate = user.CreationDate;
|
||||||
|
RevisionDate = user.RevisionDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
@ -34,6 +35,7 @@ namespace Bit.Core.Repositories.SqlServer.Models
|
|||||||
public TwoFactorProvider? TwoFactorProvider { get; set; }
|
public TwoFactorProvider? TwoFactorProvider { get; set; }
|
||||||
public string AuthenticatorKey { get; set; }
|
public string AuthenticatorKey { get; set; }
|
||||||
public DateTime CreationDate { get; set; }
|
public DateTime CreationDate { get; set; }
|
||||||
|
public DateTime RevisionDate { get; set; }
|
||||||
|
|
||||||
public User ToDomain()
|
public User ToDomain()
|
||||||
{
|
{
|
||||||
@ -49,7 +51,8 @@ namespace Bit.Core.Repositories.SqlServer.Models
|
|||||||
TwoFactorEnabled = TwoFactorEnabled,
|
TwoFactorEnabled = TwoFactorEnabled,
|
||||||
TwoFactorProvider = TwoFactorProvider,
|
TwoFactorProvider = TwoFactorProvider,
|
||||||
AuthenticatorKey = AuthenticatorKey,
|
AuthenticatorKey = AuthenticatorKey,
|
||||||
CreationDate = CreationDate
|
CreationDate = CreationDate,
|
||||||
|
RevisionDate = RevisionDate
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@
|
|||||||
<Build Include="dbo\Tables\Folder.sql" />
|
<Build Include="dbo\Tables\Folder.sql" />
|
||||||
<Build Include="dbo\Tables\Site.sql" />
|
<Build Include="dbo\Tables\Site.sql" />
|
||||||
<Build Include="dbo\Tables\User.sql" />
|
<Build Include="dbo\Tables\User.sql" />
|
||||||
<Build Include="dbo\Views\UserView.sql" />
|
|
||||||
<Build Include="dbo\Views\FolderView.sql" />
|
<Build Include="dbo\Views\FolderView.sql" />
|
||||||
<Build Include="dbo\Views\SiteView.sql" />
|
<Build Include="dbo\Views\SiteView.sql" />
|
||||||
|
<Build Include="dbo\Views\UserView.sql" />
|
||||||
<Build Include="dbo\Stored Procedures\User_ReadById.sql" />
|
<Build Include="dbo\Stored Procedures\User_ReadById.sql" />
|
||||||
<Build Include="dbo\Stored Procedures\Folder_ReadById.sql" />
|
<Build Include="dbo\Stored Procedures\Folder_ReadById.sql" />
|
||||||
<Build Include="dbo\Stored Procedures\Site_ReadById.sql" />
|
<Build Include="dbo\Stored Procedures\Site_ReadById.sql" />
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
@TwoFactorEnabled BIT,
|
@TwoFactorEnabled BIT,
|
||||||
@TwoFactorProvider TINYINT,
|
@TwoFactorProvider TINYINT,
|
||||||
@AuthenticatorKey NVARCHAR(50),
|
@AuthenticatorKey NVARCHAR(50),
|
||||||
@CreationDate DATETIME2(7)
|
@CreationDate DATETIME2(7),
|
||||||
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO [dbo].[User]
|
INSERT INTO [dbo].[User]
|
||||||
@ -24,7 +25,8 @@ BEGIN
|
|||||||
[TwoFactorEnabled],
|
[TwoFactorEnabled],
|
||||||
[TwoFactorProvider],
|
[TwoFactorProvider],
|
||||||
[AuthenticatorKey],
|
[AuthenticatorKey],
|
||||||
[CreationDate]
|
[CreationDate],
|
||||||
|
[RevisionDate]
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
@ -38,6 +40,7 @@ BEGIN
|
|||||||
@TwoFactorEnabled,
|
@TwoFactorEnabled,
|
||||||
@TwoFactorProvider,
|
@TwoFactorProvider,
|
||||||
@AuthenticatorKey,
|
@AuthenticatorKey,
|
||||||
@CreationDate
|
@CreationDate,
|
||||||
|
@RevisionDate
|
||||||
)
|
)
|
||||||
END
|
END
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
@TwoFactorEnabled BIT,
|
@TwoFactorEnabled BIT,
|
||||||
@TwoFactorProvider TINYINT,
|
@TwoFactorProvider TINYINT,
|
||||||
@AuthenticatorKey NVARCHAR(50),
|
@AuthenticatorKey NVARCHAR(50),
|
||||||
@CreationDate DATETIME2(7)
|
@CreationDate DATETIME2(7),
|
||||||
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
UPDATE
|
UPDATE
|
||||||
@ -24,7 +25,8 @@ BEGIN
|
|||||||
[TwoFactorEnabled] = @TwoFactorEnabled,
|
[TwoFactorEnabled] = @TwoFactorEnabled,
|
||||||
[TwoFactorProvider] = TwoFactorProvider,
|
[TwoFactorProvider] = TwoFactorProvider,
|
||||||
[AuthenticatorKey] = @AuthenticatorKey,
|
[AuthenticatorKey] = @AuthenticatorKey,
|
||||||
[CreationDate] = @CreationDate
|
[CreationDate] = @CreationDate,
|
||||||
|
[RevisionDate] = @RevisionDate
|
||||||
WHERE
|
WHERE
|
||||||
[Id] = @Id
|
[Id] = @Id
|
||||||
END
|
END
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
@Id UNIQUEIDENTIFIER,
|
@Id UNIQUEIDENTIFIER,
|
||||||
@Email NVARCHAR(50),
|
@Email NVARCHAR(50),
|
||||||
@MasterPassword NVARCHAR(300),
|
@MasterPassword NVARCHAR(300),
|
||||||
@SecurityStamp NVARCHAR(50)
|
@SecurityStamp NVARCHAR(50),
|
||||||
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
UPDATE
|
UPDATE
|
||||||
@ -10,7 +11,8 @@ BEGIN
|
|||||||
SET
|
SET
|
||||||
[Email] = @Email,
|
[Email] = @Email,
|
||||||
[MasterPassword] = @MasterPassword,
|
[MasterPassword] = @MasterPassword,
|
||||||
[SecurityStamp] = @SecurityStamp
|
[SecurityStamp] = @SecurityStamp,
|
||||||
|
[RevisionDate] = @RevisionDate
|
||||||
WHERE
|
WHERE
|
||||||
[Id] = @Id
|
[Id] = @Id
|
||||||
END
|
END
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
[TwoFactorProvider] TINYINT NULL,
|
[TwoFactorProvider] TINYINT NULL,
|
||||||
[AuthenticatorKey] NVARCHAR (50) NULL,
|
[AuthenticatorKey] NVARCHAR (50) NULL,
|
||||||
[CreationDate] DATETIME2 (7) NOT NULL,
|
[CreationDate] DATETIME2 (7) NOT NULL,
|
||||||
|
[RevisionDate] DATETIME2 (7) NOT NULL,
|
||||||
CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([Id] ASC)
|
CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([Id] ASC)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user