Skip to content
Snippets Groups Projects
Commit f08db13a authored by Michal Zander's avatar Michal Zander
Browse files

Remove unnecesery drop indexes flag, indexes are dropped when context is uninstalled

parent 637c8cab
No related branches found
No related tags found
1 merge request!298Unify API returns to sql composite types
......@@ -167,7 +167,7 @@ CREATE OR REPLACE FUNCTION hafbe_backend.blocksearch_account_range(
_current_block INT
)
RETURNS hafbe_backend.blocksearch_account_filter_return -- noqa: LT01, CP05
LANGUAGE 'plpgsql' IMMUTABLE
LANGUAGE 'plpgsql' STABLE
SET JIT = OFF
AS
$$
......
......@@ -18,7 +18,6 @@ EOF
POSTGRES_HOST="localhost"
POSTGRES_PORT=5432
POSTGRES_USER="haf_admin"
DROP_INDEXES=0
while [ $# -gt 0 ]; do
case "$1" in
......@@ -31,9 +30,6 @@ while [ $# -gt 0 ]; do
--user=*)
POSTGRES_USER="${1#*=}"
;;
--drop-indexes*)
DROP_INDEXES=1
;;
--help|-h|-\?)
print_help
exit 0
......@@ -73,25 +69,6 @@ uninstall_app() {
psql "$POSTGRES_ACCESS_ADMIN" -c "DROP OWNED BY hafbe_user CASCADE" || true
psql "$POSTGRES_ACCESS_ADMIN" -c "DROP ROLE IF EXISTS hafbe_user" || true
if [ "${DROP_INDEXES}" -eq 1 ]; then
echo "Attempting to drop indexes built by application"
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_search_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_search_permlink_author;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_vote_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_delete_comment_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_options_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_author_reward_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_curation_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_benefactor_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_payout_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_comment_reward_author_permlink;'
psql -aw "$POSTGRES_ACCESS_ADMIN" -v ON_ERROR_STOP=on -c 'DROP INDEX IF EXISTS hafd.hive_operations_effective_vote_author_permlink;'
else
echo "Indexes created by application have been preserved"
fi
}
uninstall_app
......@@ -52,8 +52,4 @@ echo "Test 2. Uninstall app, leave indexes..."
./uninstall_app.sh --host="$POSTGRES_HOST"
echo "Uninstall app completed successfully"
echo "Test 3. Clear indexes..."
./uninstall_app.sh --host="$POSTGRES_HOST" --drop-indexes
echo "Uninstall app and clear indexes completed successfully"
popd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment