mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[PM-5518] Sql-backed IDistributedCache (#3791)
* Sql-backed IDistributedCache * sqlserver cache table * remove unused using * setup EF entity * cache indexes * add back cipher * revert SetupEntityFramework change * ef cache * EntityFrameworkCache * IServiceScopeFactory for db context * implement EntityFrameworkCache * move to _serviceScopeFactory * move to config file * ef migrations * fixes * datetime and error codes * revert migrations * migrations * format * static and namespace fix * use time provider * Move SQL migration and remove EF one for the moment * Add clean migration of just the new table * Formatting * Test Custom `IDistributedCache` Implementation * Add Back Logging * Remove Double Logging * Skip Test When Not EntityFrameworkCache * Format --------- Co-authored-by: Matt Bishop <mbishop@bitwarden.com> Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
This commit is contained in:
15
util/Migrator/DbScripts/2024-07-01_00_DistributedCache.sql
Normal file
15
util/Migrator/DbScripts/2024-07-01_00_DistributedCache.sql
Normal file
@ -0,0 +1,15 @@
|
||||
IF OBJECT_ID('[dbo].[Cache]') IS NULL
|
||||
BEGIN
|
||||
CREATE TABLE [dbo].[Cache] (
|
||||
[Id] [nvarchar](449) NOT NULL,
|
||||
[Value] [varbinary](max) NOT NULL,
|
||||
[ExpiresAtTime] [datetimeoffset](7) NOT NULL,
|
||||
[SlidingExpirationInSeconds] [bigint] NULL,
|
||||
[AbsoluteExpiration] [datetimeoffset](7) NULL,
|
||||
CONSTRAINT [PK_Cache] PRIMARY KEY CLUSTERED ([Id] ASC)
|
||||
);
|
||||
|
||||
CREATE NONCLUSTERED INDEX [IX_Cache_ExpiresAtTime]
|
||||
ON [dbo].[Cache]([ExpiresAtTime] ASC);
|
||||
END
|
||||
GO
|
Reference in New Issue
Block a user