1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 09:02:48 -05:00

Merge branch 'master' into feature/flexible-collections

This commit is contained in:
Vincent Salucci
2023-09-12 10:32:23 -05:00
21 changed files with 270 additions and 59 deletions

View File

@ -0,0 +1,5 @@
-- Reseller Providers were being created with a NULL value in the [Name] column.
-- This script will populate them with the value from [BusinessName] which was already required.
UPDATE [dbo].[Provider]
SET [Name] = [BusinessName]
WHERE [Name] IS NULL

View File

@ -6,14 +6,6 @@ The final migration is in util/Migrator/DbScripts/2023-08-10_01_RemoveClientSecr
IF COL_LENGTH('[dbo].[ApiKey]', 'ClientSecretHash') IS NOT NULL AND COL_LENGTH('[dbo].[ApiKey]', 'ClientSecret') IS NOT NULL
BEGIN
-- Add index
IF NOT EXISTS(SELECT name FROM sys.indexes WHERE name = 'IX_ApiKey_ClientSecretHash')
BEGIN
CREATE NONCLUSTERED INDEX [IX_ApiKey_ClientSecretHash]
ON [dbo].[ApiKey]([ClientSecretHash] ASC)
WITH (ONLINE = ON)
END
-- Data Migration
DECLARE @BatchSize INT = 10000
WHILE @BatchSize > 0
@ -34,9 +26,5 @@ BEGIN
COMMIT TRANSACTION Migrate_ClientSecretHash
END
-- Drop index
DROP INDEX IF EXISTS [IX_ApiKey_ClientSecretHash]
ON [dbo].[ApiKey];
END
GO