diff --git a/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs b/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs index 38ad52deda..4f2577decb 100644 --- a/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/CollectionRepository.cs @@ -141,8 +141,8 @@ public class CollectionRepository : Repository c.ReadOnly), - HidePasswords = collectionGroup.Min(c => c.HidePasswords), + ReadOnly = Convert.ToBoolean(collectionGroup.Min(c => Convert.ToInt32(c.ReadOnly))), + HidePasswords = Convert.ToBoolean(collectionGroup.Min(c => Convert.ToInt32(c.HidePasswords))), }).ToListAsync(); } } diff --git a/util/PostgresMigrations/HelperScripts/2022-03-01_00_Up_MigrateOrganizationApiKeys.psql b/util/PostgresMigrations/HelperScripts/2022-03-01_00_Up_MigrateOrganizationApiKeys.psql index 748a9ef072..d138e04644 100644 --- a/util/PostgresMigrations/HelperScripts/2022-03-01_00_Up_MigrateOrganizationApiKeys.psql +++ b/util/PostgresMigrations/HelperScripts/2022-03-01_00_Up_MigrateOrganizationApiKeys.psql @@ -4,7 +4,7 @@ INSERT INTO "OrganizationApiKey"( "ApiKey", "Type", "RevisionDate") -SELECT gen_random_uuid(), +SELECT uuid_in(overlay(overlay(md5(random()::text || ':' || random()::text) placing '4' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), "Id" AS "OrganizationId", "ApiKey", 0 AS "Type", diff --git a/util/PostgresMigrations/Scripts/2022-03-25_00_SelfHostF4E.psql b/util/PostgresMigrations/Scripts/2022-03-25_00_SelfHostF4E.psql index 3c93900158..71e26b9bb7 100644 --- a/util/PostgresMigrations/Scripts/2022-03-25_00_SelfHostF4E.psql +++ b/util/PostgresMigrations/Scripts/2022-03-25_00_SelfHostF4E.psql @@ -24,7 +24,7 @@ INSERT INTO "OrganizationApiKey"( "ApiKey", "Type", "RevisionDate") -SELECT gen_random_uuid(), +SELECT uuid_in(overlay(overlay(md5(random()::text || ':' || random()::text) placing '4' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), "Id" AS "OrganizationId", "ApiKey", 0 AS "Type",