mirror of
https://github.com/bitwarden/server.git
synced 2025-06-08 04:00:31 -05:00
Rename UserSigningKeys table to UserSigningKey
This commit is contained in:
parent
20999391b3
commit
cd0e94b6d2
@ -28,7 +28,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
|
|||||||
using (var connection = new SqlConnection(ConnectionString))
|
using (var connection = new SqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
return await connection.QuerySingleOrDefaultAsync<SigningKeyData>(
|
return await connection.QuerySingleOrDefaultAsync<SigningKeyData>(
|
||||||
"[dbo].[UserSigningKeys_ReadByUserId]",
|
"[dbo].[UserSigningKey_ReadByUserId]",
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = userId
|
UserId = userId
|
||||||
@ -42,7 +42,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
|
|||||||
return async (SqlConnection connection, SqlTransaction transaction) =>
|
return async (SqlConnection connection, SqlTransaction transaction) =>
|
||||||
{
|
{
|
||||||
await connection.QueryAsync(
|
await connection.QueryAsync(
|
||||||
"[dbo].[UserSigningKeys_SetForRotation]",
|
"[dbo].[UserSigningKey_SetForRotation]",
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
@ -63,7 +63,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
|
|||||||
return async (SqlConnection connection, SqlTransaction transaction) =>
|
return async (SqlConnection connection, SqlTransaction transaction) =>
|
||||||
{
|
{
|
||||||
await connection.QueryAsync(
|
await connection.QueryAsync(
|
||||||
"[dbo].[UserSigningKeys_UpdateForRotation]",
|
"[dbo].[UserSigningKey_UpdateForRotation]",
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
UserId = grantorId,
|
UserId = grantorId,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId]
|
CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
|
||||||
@UserId UNIQUEIDENTIFIER
|
@UserId UNIQUEIDENTIFIER
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM [dbo].[UserSigningKeys]
|
FROM [dbo].[UserSigningKey]
|
||||||
WHERE [UserId] = @UserId;
|
WHERE [UserId] = @UserId;
|
||||||
END
|
END
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
|
CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
|
||||||
@UserId UNIQUEIDENTIFIER,
|
@UserId UNIQUEIDENTIFIER,
|
||||||
@KeyType TINYINT,
|
@KeyType TINYINT,
|
||||||
@VerifyingKey VARCHAR(MAX),
|
@VerifyingKey VARCHAR(MAX),
|
||||||
@ -6,7 +6,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
|
|||||||
@RevisionDate DATETIME2(7)
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
UPDATE [dbo].[UserSigningKeys]
|
UPDATE [dbo].[UserSigningKey]
|
||||||
SET [KeyType] = @KeyType,
|
SET [KeyType] = @KeyType,
|
||||||
[VerifyingKey] = @VerifyingKey,
|
[VerifyingKey] = @VerifyingKey,
|
||||||
[SigningKey] = @SigningKey,
|
[SigningKey] = @SigningKey,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
|
CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
|
||||||
@Id UNIQUEIDENTIFIER,
|
@Id UNIQUEIDENTIFIER,
|
||||||
@UserId UNIQUEIDENTIFIER,
|
@UserId UNIQUEIDENTIFIER,
|
||||||
@KeyType TINYINT,
|
@KeyType TINYINT,
|
||||||
@ -8,6 +8,6 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
|
|||||||
@RevisionDate DATETIME2(7)
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO [dbo].[UserSigningKeys] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
|
INSERT INTO [dbo].[UserSigningKey] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
|
||||||
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
|
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
|
||||||
END
|
END
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CREATE TABLE [dbo].[UserSigningKeys] (
|
CREATE TABLE [dbo].[UserSigningKey] (
|
||||||
[Id] UNIQUEIDENTIFIER NOT NULL,
|
[Id] UNIQUEIDENTIFIER NOT NULL,
|
||||||
[UserId] UNIQUEIDENTIFIER,
|
[UserId] UNIQUEIDENTIFIER,
|
||||||
[KeyType] TINYINT NOT NULL,
|
[KeyType] TINYINT NOT NULL,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CREATE TABLE [dbo].[UserSigningKeys] (
|
CREATE TABLE [dbo].[UserSigningKey] (
|
||||||
[Id] UNIQUEIDENTIFIER NOT NULL,
|
[Id] UNIQUEIDENTIFIER NOT NULL,
|
||||||
[UserId] UNIQUEIDENTIFIER,
|
[UserId] UNIQUEIDENTIFIER,
|
||||||
[KeyType] TINYINT NOT NULL,
|
[KeyType] TINYINT NOT NULL,
|
||||||
@ -11,17 +11,17 @@ CREATE TABLE [dbo].[UserSigningKeys] (
|
|||||||
);
|
);
|
||||||
GO
|
GO
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId]
|
CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
|
||||||
@UserId UNIQUEIDENTIFIER
|
@UserId UNIQUEIDENTIFIER
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM [dbo].[UserSigningKeys]
|
FROM [dbo].[UserSigningKey]
|
||||||
WHERE [UserId] = @UserId;
|
WHERE [UserId] = @UserId;
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
|
CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
|
||||||
@UserId UNIQUEIDENTIFIER,
|
@UserId UNIQUEIDENTIFIER,
|
||||||
@KeyType TINYINT,
|
@KeyType TINYINT,
|
||||||
@VerifyingKey VARCHAR(MAX),
|
@VerifyingKey VARCHAR(MAX),
|
||||||
@ -29,7 +29,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
|
|||||||
@RevisionDate DATETIME2(7)
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
UPDATE [dbo].[UserSigningKeys]
|
UPDATE [dbo].[UserSigningKey]
|
||||||
SET [KeyType] = @KeyType,
|
SET [KeyType] = @KeyType,
|
||||||
[VerifyingKey] = @VerifyingKey,
|
[VerifyingKey] = @VerifyingKey,
|
||||||
[SigningKey] = @SigningKey,
|
[SigningKey] = @SigningKey,
|
||||||
@ -38,7 +38,7 @@ BEGIN
|
|||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
|
CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
|
||||||
@Id UNIQUEIDENTIFIER,
|
@Id UNIQUEIDENTIFIER,
|
||||||
@UserId UNIQUEIDENTIFIER,
|
@UserId UNIQUEIDENTIFIER,
|
||||||
@KeyType TINYINT,
|
@KeyType TINYINT,
|
||||||
@ -48,7 +48,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
|
|||||||
@RevisionDate DATETIME2(7)
|
@RevisionDate DATETIME2(7)
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT INTO [dbo].[UserSigningKeys] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
|
INSERT INTO [dbo].[UserSigningKey] ([Id], [UserId], [KeyType], [VerifyingKey], [SigningKey], [CreationDate], [RevisionDate])
|
||||||
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
|
VALUES (@Id, @UserId, @KeyType, @VerifyingKey, @SigningKey, @CreationDate, @RevisionDate)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
Loading…
x
Reference in New Issue
Block a user