1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Update 2024-09-05_00_SyncDuoVersionFourMetadataToVersionTwo.sql (#4982)

Fix MariaDB compatibility with JSON_EXTRACT

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
holow29 2024-11-06 16:45:09 -05:00 committed by GitHub
parent 355ebfa889
commit 639ee5780b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,9 +5,9 @@ SET
U.TwoFactorProviders = JSON_SET(
JSON_SET(
U.TwoFactorProviders, '$."2".MetaData.ClientSecret',
JSON_UNQUOTE(U.TwoFactorProviders ->'$."2".MetaData.SKey')),
JSON_UNQUOTE(JSON_EXTRACT(U.TwoFactorProviders,'$."2".MetaData.SKey'))),
'$."2".MetaData.ClientId',
JSON_UNQUOTE(U.TwoFactorProviders -> '$."2".MetaData.IKey'))
JSON_UNQUOTE(JSON_EXTRACT(U.TwoFactorProviders,'$."2".MetaData.IKey')))
WHERE
JSON_CONTAINS(TwoFactorProviders,
'{"2":{}}')
@ -20,9 +20,9 @@ SET
o.TwoFactorProviders = JSON_SET(
JSON_SET(
o.TwoFactorProviders, '$."6".MetaData.ClientSecret',
JSON_UNQUOTE(o.TwoFactorProviders ->'$."6".MetaData.SKey')),
JSON_UNQUOTE(JSON_EXTRACT(o.TwoFactorProviders,'$."6".MetaData.SKey'))),
'$."6".MetaData.ClientId',
JSON_UNQUOTE(o.TwoFactorProviders -> '$."6".MetaData.IKey'))
JSON_UNQUOTE(JSON_EXTRACT(o.TwoFactorProviders,'$."6".MetaData.IKey')))
WHERE
JSON_CONTAINS(o.TwoFactorProviders,
'{"6":{}}')