Koha-clms/debian/scripts
Rudolf Byker 58dffef7b2 Bug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.
When restoring a Koha instance, and the database user does not exist, an error is shown,
although it is prevented from stopping the script by ` || true`. This patch removes the
` || true` guard, and rather uses `DROP USER IF EXISTS` which does exactly what one
would expect, without confusing error messages, whether the user existed or not.

To test:
1) Assume your Koha instance is called `asdf`.
1) Export the Koha instance using `koha-dump`.
2) Remove the instance completely using `koha-remove`.
3) Import it again using `koha-restore`.
4) No error should be shown, and the import should work. There was NO user to drop, therefore `DROP USER IF EXISTS` did nothing.
5) A database user called `koha_asdf` should exist, and have all privileges on the database of the same name.
6) Remove the instance again using `koha-remove`.
7) Now create a database user in MySQL called `koha_instance` where instance is the name of your dumped koha instance.
8) Import your koha instance again using `koha-restore`.
9) Again, no error should be shown, and the import should work. There WAS a user to drop, therefore `DROP USER IF EXISTS` dropped the user before creating a new one.
10) Again, a database user called `koha_asdf` should exist, and have all privileges on the database of the same name.

Sponsored-by: Reformational Study Centre
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2022-05-13 12:10:31 -04:00
..
koha-create Bug 29957: Add --keep-cookie option to koha-create 2022-04-15 07:15:21 -04:00
koha-create-dirs
…
koha-disable Bug 22417: Add debian script koha-worker 2020-10-05 15:22:44 +02:00
koha-dump Bug 28749: Restore the database name to Koha dumps 2021-07-30 15:54:05 +02:00
koha-dump-defaults
…
koha-elasticsearch Bug 26448: Don't overwrite commit parameter passed to koha-elasticsearch 2020-09-18 11:49:29 +02:00
koha-email-disable
…
koha-email-enable
…
koha-enable
…
koha-foreach Bug 25634: Warn if koha-shell returns non-zero in koha-foreach 2020-06-12 10:32:30 +02:00
koha-functions.sh Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory 2021-06-17 10:07:36 +02:00
koha-indexer Bug 27348: Fix test on ALTERNATE_INDEXER_DAEMON in koha-indexer 2021-06-21 12:07:28 +02:00
koha-list Bug 13937: Add support for Z39.50 responder to the Debian scripts 2019-10-08 14:40:07 +01:00
koha-mysql
…
koha-mysqlcheck
…
koha-passwd
…
koha-plack Bug 25778: Fix var scope in koha-plack for PERL5LIB and KOHA_HOME 2020-08-18 15:45:49 +02:00
koha-rebuild-zebra
…
koha-remove Bug 22417: Add debian script koha-worker 2020-10-05 15:22:44 +02:00
koha-reset-passwd
…
koha-restore Bug 10517: Use `DROP USER IF EXISTS` and remove ` || true`. 2022-05-13 12:10:31 -04:00
koha-run-backups Bug 21111: Add --exclude-indexes to koha-run-backups 2020-11-04 12:59:34 +01:00
koha-shell Bug 28519: Add lib to koha-shell 2021-06-17 15:59:40 +02:00
koha-sip Bug 24993: fix increment 2020-04-14 08:33:00 +01:00
koha-sitemap
…
koha-translate Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
koha-upgrade-schema
…
koha-upgrade-to-3.4
…
koha-worker Bug 27839: (follow-up) Update docs for koha-worker 2021-04-12 15:27:50 +02:00
koha-z3950-responder Bug 25618: Fix wrong package install path for misc dir 2020-05-29 11:44:54 +02:00
koha-zebra
…