1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

[AC-1682] Added EF migrations

This commit is contained in:
Rui Tome
2023-12-17 21:26:12 +00:00
parent b7773b6fe8
commit 003b6dcc4d
21 changed files with 8790 additions and 1267 deletions

View File

@ -0,0 +1,12 @@
-- Update "CollectionUser" with "Manage" = 1 for all users with Manager role or 'EditAssignedCollections' permission
UPDATE "CollectionUsers"
SET "ReadOnly" = 0,
"HidePasswords" = 0,
"Manage" = 1
WHERE "OrganizationUserId" IN (
SELECT cu."OrganizationUserId"
FROM "CollectionUsers" cu
INNER JOIN "OrganizationUser" ou ON cu."OrganizationUserId" = ou."Id"
WHERE ou."Type" = 3 OR (ou."Permissions" IS NOT NULL AND
JSON_VALID(ou."Permissions") AND json_extract(ou."Permissions", '$.editAssignedCollections') = 'true')
);