mirror of
https://github.com/bitwarden/server
synced 2026-01-16 23:43:22 +00:00
[SM-678] ClientSecret migration (#2943)
* Init ClientSecret migration * Fix unit tests * Move to src/Sql/dbo_future * Formatting changes * Update migration date for next release * Swap to just executing sp_refreshview * Fix formatting * Add EF Migrations * Rename to ClientSecretHash * Fix unit test * EF column rename * Batch the migration * Fix formatting * Add deprecation notice to property * Move data migration * Swap to CREATE OR ALTER
This commit is contained in:
18
src/Sql/dbo_future/Tables/ApiKey.sql
Normal file
18
src/Sql/dbo_future/Tables/ApiKey.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE [dbo].[ApiKey] (
|
||||
[Id] UNIQUEIDENTIFIER,
|
||||
[ServiceAccountId] UNIQUEIDENTIFIER NULL,
|
||||
[Name] VARCHAR(200) NOT NULL,
|
||||
[ClientSecretHash] VARCHAR(128) NULL,
|
||||
[Scope] NVARCHAR (4000) NOT NULL,
|
||||
[EncryptedPayload] NVARCHAR (4000) NOT NULL,
|
||||
[Key] VARCHAR (MAX) NOT NULL,
|
||||
[ExpireAt] DATETIME2(7) NULL,
|
||||
[CreationDate] DATETIME2(7) NOT NULL,
|
||||
[RevisionDate] DATETIME2(7) NOT NULL,
|
||||
CONSTRAINT [PK_ApiKey] PRIMARY KEY CLUSTERED ([Id] ASC),
|
||||
CONSTRAINT [FK_ApiKey_ServiceAccountId] FOREIGN KEY ([ServiceAccountId]) REFERENCES [dbo].[ServiceAccount] ([Id])
|
||||
);
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_ApiKey_ServiceAccountId]
|
||||
ON [dbo].[ApiKey]([ServiceAccountId] ASC);
|
||||
Reference in New Issue
Block a user