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

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

@caillou

Description

@caillou

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions