Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Fix mergeUsers mutation with regard to answers and other constraints #516

Open
caillou opened this issue Sep 21, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@caillou
Copy link
Contributor

caillou commented Sep 21, 2020

As of now, the userId of an answer can not be modified due to the following PG trigger:

IF (
TG_OP = 'UPDATE' AND
NEW."userId" IS NOT NULL AND
NEW."userId" != OLD."userId"
) THEN
RAISE EXCEPTION 'PSQL EXCEPTION: answers must not switch users';
END IF;

A possible workarround could be this: 0ad0aca

As of now, I am not certain if this PG trigger is important, and if the above code change would break something.

Additionally, mergeUsers() might fail due to unic constraints. We need to figure out a good way to automatically merge such users.

@patrickvenetz patrickvenetz added the bug Something isn't working label Sep 20, 2021
@fuenkchen
Copy link
Contributor

We first do #517 to get an overview of problems we have with mergeUsers mutations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants