Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 Mar 2020 08:55:03 +0000 (09:55 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 4 Mar 2020 14:44:10 +0000 (14:44 +0000)
commit5b78de6cefd7daf16f8ec0e95cb3e5e155fd8ac7
treebd4214d74fb5a7ee965c90e673f5b3861758ade1
parent027f72da7c7bea317e977ed7fba0a06d6840d14a
Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017

Previous version of the SQL query did not deal correctly with subgroup.

Test plan:
checkout the following commit to be just before 017
  commit 715da06db557edc4b1baa51cc278fdac362c01c4
  Bug 22868: DBRev 19.12.00.016
reset_all # recreate the DB
Create a complex tree of library groups, with several groups, subgroups,
etc.
When you add a new library, refresh the page to add it several time.
When ready, git checkout master, restart all the things, execute the
updatedatabase script, then go to the library groups page.
You should see that the duplicated entries have been removed, but
subgroups have not been deleted

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tested with duplicated entries on groups and subgroups,
going back to the right commit and doing clean install.
Patch works, subgroups are preserved. No errors.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
installer/data/mysql/updatedatabase.pl