From cd0e94b6d2bef8c15f8c592928f491ec1e080020 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 2 Jun 2025 14:54:15 +0200 Subject: [PATCH] Rename UserSigningKeys table to UserSigningKey --- .../Repositories/UserSigningKeysRepository.cs | 6 +++--- .../UserSigningKeys_ReadByUserId.sql | 4 ++-- .../UserSigningKeys_SetForRotation.sql | 4 ++-- .../UserSigningKeys_UpdateForRotation.sql | 4 ++-- src/Sql/dbo/Tables/UserSigningKey.sql | 2 +- .../2025-05-01_00_AddSigningKeysTable.sql | 14 +++++++------- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Infrastructure.Dapper/KeyManagement/Repositories/UserSigningKeysRepository.cs b/src/Infrastructure.Dapper/KeyManagement/Repositories/UserSigningKeysRepository.cs index 1c3f78f4ca..dc91d7f8f5 100644 --- a/src/Infrastructure.Dapper/KeyManagement/Repositories/UserSigningKeysRepository.cs +++ b/src/Infrastructure.Dapper/KeyManagement/Repositories/UserSigningKeysRepository.cs @@ -28,7 +28,7 @@ public class UserSigningKeysRepository : Repository, IUse using (var connection = new SqlConnection(ConnectionString)) { return await connection.QuerySingleOrDefaultAsync( - "[dbo].[UserSigningKeys_ReadByUserId]", + "[dbo].[UserSigningKey_ReadByUserId]", new { UserId = userId @@ -42,7 +42,7 @@ public class UserSigningKeysRepository : Repository, 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, IUse return async (SqlConnection connection, SqlTransaction transaction) => { await connection.QueryAsync( - "[dbo].[UserSigningKeys_UpdateForRotation]", + "[dbo].[UserSigningKey_UpdateForRotation]", new { UserId = grantorId, diff --git a/src/Sql/dbo/Stored Procedures/UserSigningKeys_ReadByUserId.sql b/src/Sql/dbo/Stored Procedures/UserSigningKeys_ReadByUserId.sql index 25e1ce2239..89ddc8b0fd 100644 --- a/src/Sql/dbo/Stored Procedures/UserSigningKeys_ReadByUserId.sql +++ b/src/Sql/dbo/Stored Procedures/UserSigningKeys_ReadByUserId.sql @@ -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 diff --git a/src/Sql/dbo/Stored Procedures/UserSigningKeys_SetForRotation.sql b/src/Sql/dbo/Stored Procedures/UserSigningKeys_SetForRotation.sql index d4ee47c980..e197172f71 100644 --- a/src/Sql/dbo/Stored Procedures/UserSigningKeys_SetForRotation.sql +++ b/src/Sql/dbo/Stored Procedures/UserSigningKeys_SetForRotation.sql @@ -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, diff --git a/src/Sql/dbo/Stored Procedures/UserSigningKeys_UpdateForRotation.sql b/src/Sql/dbo/Stored Procedures/UserSigningKeys_UpdateForRotation.sql index 0a8b0b18d7..79c02c703f 100644 --- a/src/Sql/dbo/Stored Procedures/UserSigningKeys_UpdateForRotation.sql +++ b/src/Sql/dbo/Stored Procedures/UserSigningKeys_UpdateForRotation.sql @@ -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 diff --git a/src/Sql/dbo/Tables/UserSigningKey.sql b/src/Sql/dbo/Tables/UserSigningKey.sql index 214504fcf8..71cf4b3a8f 100644 --- a/src/Sql/dbo/Tables/UserSigningKey.sql +++ b/src/Sql/dbo/Tables/UserSigningKey.sql @@ -1,4 +1,4 @@ -CREATE TABLE [dbo].[UserSigningKeys] ( +CREATE TABLE [dbo].[UserSigningKey] ( [Id] UNIQUEIDENTIFIER NOT NULL, [UserId] UNIQUEIDENTIFIER, [KeyType] TINYINT NOT NULL, diff --git a/util/Migrator/DbScripts/2025-05-01_00_AddSigningKeysTable.sql b/util/Migrator/DbScripts/2025-05-01_00_AddSigningKeysTable.sql index 57e59a9417..d74a9e795a 100644 --- a/util/Migrator/DbScripts/2025-05-01_00_AddSigningKeysTable.sql +++ b/util/Migrator/DbScripts/2025-05-01_00_AddSigningKeysTable.sql @@ -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