drop every trace on reinstall

Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Daniel Hansson 2022-08-18 18:36:29 +00:00 committed by GitHub
parent cb7680b2d5
commit 1a2a0cb006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,10 +35,13 @@ then
else
# Ask for removal or reinstallation
reinstall_remove_menu "$SCRIPT_NAME"
# Reset database table
check_command sudo -Hiu postgres psql "$NCDB" -c "TRUNCATE TABLE oc_fulltextsearch_ticks;"
# Reset Full Text Search to be able to index again, and also remove the app to be able to install it again
nextcloud_occ_no_check fulltextsearch:reset
# Drop database tables
check_command sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_ticks;"
check_command sudo -Hiu postgres psql "$NCDB" -c "DROP TABLE oc_fulltextsearch_index;"
check_command sudo -Hiu postgres psql "$NCDB" -c "DELETE FROM oc_migrations WHERE app='fulltextsearch';"
check_command sudo -Hiu postgres psql "$NCDB" -c "DELETE FROM oc_preferences WHERE appid='fulltextsearch';"
APPS=(fulltextsearch fulltextsearch_elasticsearch files_fulltextsearch)
for app in "${APPS[@]}"
do