1
0
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:
Bernd Schoolmann 2025-06-02 14:54:15 +02:00
parent 20999391b3
commit cd0e94b6d2
No known key found for this signature in database
6 changed files with 17 additions and 17 deletions

View File

@ -28,7 +28,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
using (var connection = new SqlConnection(ConnectionString))
{
return await connection.QuerySingleOrDefaultAsync<SigningKeyData>(
"[dbo].[UserSigningKeys_ReadByUserId]",
"[dbo].[UserSigningKey_ReadByUserId]",
new
{
UserId = userId
@ -42,7 +42,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
return async (SqlConnection connection, SqlTransaction transaction) =>
{
await connection.QueryAsync(
"[dbo].[UserSigningKeys_SetForRotation]",
"[dbo].[UserSigningKey_SetForRotation]",
new
{
Id = Guid.NewGuid(),
@ -63,7 +63,7 @@ public class UserSigningKeysRepository : Repository<UserSigningKeys, Guid>, IUse
return async (SqlConnection connection, SqlTransaction transaction) =>
{
await connection.QueryAsync(
"[dbo].[UserSigningKeys_UpdateForRotation]",
"[dbo].[UserSigningKey_UpdateForRotation]",
new
{
UserId = grantorId,

View File

@ -1,8 +1,8 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId]
CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
@UserId UNIQUEIDENTIFIER
AS
BEGIN
SELECT *
FROM [dbo].[UserSigningKeys]
FROM [dbo].[UserSigningKey]
WHERE [UserId] = @UserId;
END

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
@UserId UNIQUEIDENTIFIER,
@KeyType TINYINT,
@VerifyingKey VARCHAR(MAX),
@ -6,7 +6,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
@RevisionDate DATETIME2(7)
AS
BEGIN
UPDATE [dbo].[UserSigningKeys]
UPDATE [dbo].[UserSigningKey]
SET [KeyType] = @KeyType,
[VerifyingKey] = @VerifyingKey,
[SigningKey] = @SigningKey,

View File

@ -1,4 +1,4 @@
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@KeyType TINYINT,
@ -8,6 +8,6 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
@RevisionDate DATETIME2(7)
AS
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)
END

View File

@ -1,4 +1,4 @@
CREATE TABLE [dbo].[UserSigningKeys] (
CREATE TABLE [dbo].[UserSigningKey] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER,
[KeyType] TINYINT NOT NULL,

View File

@ -1,4 +1,4 @@
CREATE TABLE [dbo].[UserSigningKeys] (
CREATE TABLE [dbo].[UserSigningKey] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER,
[KeyType] TINYINT NOT NULL,
@ -11,17 +11,17 @@ CREATE TABLE [dbo].[UserSigningKeys] (
);
GO
CREATE PROCEDURE [dbo].[UserSigningKeys_ReadByUserId]
CREATE PROCEDURE [dbo].[UserSigningKey_ReadByUserId]
@UserId UNIQUEIDENTIFIER
AS
BEGIN
SELECT *
FROM [dbo].[UserSigningKeys]
FROM [dbo].[UserSigningKey]
WHERE [UserId] = @UserId;
END
GO
CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
CREATE PROCEDURE [dbo].[UserSigningKey_UpdateForRotation]
@UserId UNIQUEIDENTIFIER,
@KeyType TINYINT,
@VerifyingKey VARCHAR(MAX),
@ -29,7 +29,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_UpdateForRotation]
@RevisionDate DATETIME2(7)
AS
BEGIN
UPDATE [dbo].[UserSigningKeys]
UPDATE [dbo].[UserSigningKey]
SET [KeyType] = @KeyType,
[VerifyingKey] = @VerifyingKey,
[SigningKey] = @SigningKey,
@ -38,7 +38,7 @@ BEGIN
END
GO
CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
CREATE PROCEDURE [dbo].[UserSigningKey_SetForRotation]
@Id UNIQUEIDENTIFIER,
@UserId UNIQUEIDENTIFIER,
@KeyType TINYINT,
@ -48,7 +48,7 @@ CREATE PROCEDURE [dbo].[UserSigningKeys_SetForRotation]
@RevisionDate DATETIME2(7)
AS
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)
END
GO