Support script-driven upgrades for version 32.0.x
This commit is contained in:
@@ -609,7 +609,6 @@ if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
|
||||
mysql $MYSQL_CREDENTIALS $DATABASE_NAME -N -s -e "DROP TABLE \`$_table\`" >> $log_file 2>&1
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
_failed=true
|
||||
_tables_not_deleted+=("$_table")
|
||||
fi
|
||||
done
|
||||
if $_failed ; then
|
||||
@@ -617,30 +616,50 @@ if [[ "$DATABASE_TYPE" = 'mysql' ]]; then
|
||||
echo_failed
|
||||
error "\n\n$(cat $log_file)"
|
||||
|
||||
if [[ ${#_tables_not_deleted[@]} -gt 0 ]] ; then
|
||||
echo ""
|
||||
echo "Tables NOT deleted:"
|
||||
for _table in "${_tables_not_deleted[@]}" ; do
|
||||
echo " $_table"
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
echononl "continue anyway [yes/no]: "
|
||||
read OK
|
||||
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||
echononl "Wrong entry! - repeat [yes/no]: "
|
||||
read OK
|
||||
_tables_not_deleted=()
|
||||
_failed=false
|
||||
_TABLES="$(mysql $MYSQL_CREDENTIALS $DATABASE_NAME -N -s -e "show tables" 2> $log_file)"
|
||||
echononl " Try again dropping tables from database '$DATABASE_NAME' .."
|
||||
for _table in $_TABLES ; do
|
||||
mysql $MYSQL_CREDENTIALS $DATABASE_NAME -N -s -e "DROP TABLE \`$_table\`" >> $log_file 2>&1
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
_failed=true
|
||||
_tables_not_deleted+=("$_table")
|
||||
fi
|
||||
done
|
||||
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||
blank_line
|
||||
if $_failed ; then
|
||||
|
||||
echo_failed
|
||||
error "\n\n$(cat $log_file)"
|
||||
|
||||
if [[ ${#_tables_not_deleted[@]} -gt 0 ]] ; then
|
||||
echo ""
|
||||
echo "Tables NOT deleted:"
|
||||
for _table in "${_tables_not_deleted[@]}" ; do
|
||||
echo " $_table"
|
||||
done
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
||||
echononl "continue anyway [yes/no]: "
|
||||
read OK
|
||||
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
|
||||
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
|
||||
echononl "Wrong entry! - repeat [yes/no]: "
|
||||
read OK
|
||||
done
|
||||
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
|
||||
blank_line
|
||||
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
else
|
||||
echo_ok
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user