LP 1786534: Don't merge a user with itself. user/mmorgan/lp1786534_no_merging_user_with_itself_signoff
authorJason Stephenson <jason@sigio.com>
Fri, 10 Aug 2018 19:10:04 +0000 (15:10 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Wed, 12 Sep 2018 15:00:24 +0000 (11:00 -0400)
commitd6391134adf82c051b74518f3704fa64e3271368
tree4480ad43a2022572435b18a50a977a4d83ced60c
parentef3fa1488e4a84f998a4ba2671d796a553f7c07c
LP 1786534: Don't merge a user with itself.

It's possible to merge a user with itself using the actor.usr_merge
database function.  This does not produce a useful result.  One ends
up with a user that is flagged deleted, has a null card field, and is
likely to have their addresses and other cards deleted from the
database.

A simple check at the top of the database function to bail if the
src_usr and dest_usr are the same prevents this from happening.  That
is the change that this commit makes.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/sql/Pg/999.functions.global.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.actor_usr_merge-bail-on-same-user.sql [new file with mode: 0644]