Bug 20754: DB revision to remove double accepted shares
commit875108d46e0dacec4221261a29e680023fa5167d
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 4 May 2018 08:42:38 +0000 (4 10:42 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 11:25:30 +0000 (6 12:25 +0100)
tree53b8119b3fa977c4dfd6205aa44e9b62abbf3a0e
parentda3606ac3ff10df6fb111d96070d6d33d0b37f34
Bug 20754: DB revision to remove double accepted shares

[Originally submitted for bug 11943, parked at 20754.]
[Attempt to revive it now.]

Although it is no problem to have them, we could do a cleanup.
This patch just removes duplicate rows from the table.

Note: I considered adding a unique index like:
    ALTER TABLE virtualshelfshares ADD UNIQUE INDEX (shelfnumber, borrowernumber, invitekey);
But the possible NULL values in borrowernumber and/or invitekey require
additional code changes. So I left it alone.

Test plan:
[1] Create two records with same borrowernumber and shelfnumber in the shares
    table, if not present already.
[2] Run updatedatabase.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
installer/data/mysql/atomicupdate/bug20754.perl [new file with mode: 0644]