1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-24 14:26:38 -05:00
bitwarden/util/Setup/DbScripts/2018-03-12_00_FixLoginUris.sql
2018-03-12 08:44:51 -04:00

33 lines
507 B
Transact-SQL

/*
{
"Name":"2.xx",
"Username":"2.zz",
"Password":"2.aa",
"Uris":"[{\"Uri\":\"2.yy\"}]"
}
=>
{
"Name":"2.xx",
"Username":"2.zz",
"Password":"2.aa",
"Uris":[{"Uri": "2.yy"}]
}
*/
DECLARE @UrisPath VARCHAR(50) = '$.Uris'
UPDATE
[dbo].[Cipher]
SET
[Data] = JSON_MODIFY(
[Data],
@UrisPath,
JSON_QUERY(
JSON_VALUE([Data], @UrisPath),
'$'
)
)
WHERE
LEFT(JSON_VALUE([Data], @UrisPath), 8) = '[{"Uri":'
GO