Skip to content
Snippets Groups Projects
Commit 9cff6305 authored by Krzysztof Leśniak's avatar Krzysztof Leśniak Committed by Bartek Wrona
Browse files

Add check_tables_dont_reference_haf_domains

This makes the same check as check_tables_dont_reference_haf_types, but
for domains.
parent 760d885b
No related branches found
No related tags found
6 merge requests!627merge in fix for get_current_block_age,!626Fix get_current_block_age function to avoid healthcheck fails,!622merge develop to master,!599merge ( with merge commit) develop to master,!597Merge develop to master for release,!366Improve HAF upgrade script
......@@ -150,6 +150,15 @@ check_tables_dont_reference_haf_types() {
awk -F'|' '{print($1"."$2, "contains column", $3, "of type", $4"."$5, "which would be dropped on upgrade")} END{exit NR > 0 ? 4 : 0}'
}
check_tables_dont_reference_haf_domains() {
echo
echo "Checking that none table references HAF domain..."
query="SELECT table_schema,table_name,column_name,domain_schema,domain_name FROM information_schema.columns WHERE domain_schema='hive' AND table_schema<>'hive'"
sudo -Enu "$DB_ADMIN" psql -w $POSTGRES_ACCESS -d "$DB_NAME" -v ON_ERROR_STOP=on -U "$DB_ADMIN" -q -t -A -c "$query" | \
awk -F'|' '{print($1"."$2, "contains column", $3, "of type", $4"."$5, "which would be dropped on upgrade")} END{exit NR > 0 ? 4 : 0}'
}
check_functions_were_updated() {
echo
echo "Checking that all C functions were properly updated..."
......@@ -172,6 +181,8 @@ generate_final_update_script
check_tables_dont_reference_haf_types
check_tables_dont_reference_haf_domains
make_update
check_functions_were_updated
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