Commit 3aa29760 authored by qa_quantgroup's avatar qa_quantgroup

update

parent 29bdce17
......@@ -7,13 +7,20 @@
# -------------------------------------------------------------------------------
mysql_host=$1
db_name=$2
sql_file_folder=/home/qa-deploy-utils/db-utils/sql_to_run
echo "cd $sql_file_folder"
cd $sql_file_folder
for entry in ./*
do
if [ -n "$db_name" ];then
if [ -f $db_name.sql ];then
echo "mysql -h $mysql_host -uqa -pqatest < $db_name.sql"
mysql -h $mysql_host -uqa -pqatest < $db_name.sql
fi
else
for entry in ./*
do
echo "run sql file: $entry"
mysql -h $mysql_host -uqa -pqatest < $entry
done
\ No newline at end of file
done
fi
......@@ -100,7 +100,7 @@ function db_schema_sync()
function run_sql_file()
{
echo "run sql files on ${target_db_host}"
sh $work_dir/db_execute_sql.sh $target_db_host
sh $work_dir/db_execute_sql.sh $target_db_host $sync_db_name
}
database_list='cash_loan_flow contract dujiangyan financial_system fund_manage gyxd mall merchant offline payment_center qinqiong quartz redpacket risk_control spider_center xyqb xyqb_app xyqb_user'
......@@ -112,14 +112,10 @@ then
db_schema_sync $db_name
echo $db_name
done
if [ $run_sql_file = true ]; then
echo $run_sql_file
run_sql_file
fi
else
db_schema_sync $sync_db_name
if [ $run_sql_file = true ]; then
run_sql_file
fi
run_sql_file $sync_db_name
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment