0
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden synced 2024-12-14 17:43:46 +01:00

Fix Org API Key generation on PosgreSQL

Using PostgreSQL creating or rotating the Org API Key failed because of
some query mismatch. This PR fixes that.

Fixes https://github.com/dani-garcia/vaultwarden/discussions/3671#discussioncomment-6400394
This commit is contained in:
BlackDex 2023-07-10 15:29:06 +02:00
parent 1c7338c7c4
commit a8e5384c4a
No known key found for this signature in database
GPG key ID: 58C80A2AA6C765E1

View file

@ -804,7 +804,7 @@ impl OrganizationApiKey {
let value = OrganizationApiKeyDb::to_db(self); let value = OrganizationApiKeyDb::to_db(self);
diesel::insert_into(organization_api_key::table) diesel::insert_into(organization_api_key::table)
.values(&value) .values(&value)
.on_conflict(organization_api_key::uuid) .on_conflict((organization_api_key::uuid, organization_api_key::org_uuid))
.do_update() .do_update()
.set(&value) .set(&value)
.execute(conn) .execute(conn)