Commit 5d3fedb0 authored by qa_quantgroup's avatar qa_quantgroup
parents 9b552b63 adea5937
...@@ -23,6 +23,8 @@ config_file_name=$8 ...@@ -23,6 +23,8 @@ config_file_name=$8
db_backup_sub_folders=$9 db_backup_sub_folders=$9
port="" port=""
sys_table_list=""
sync_config_folder=~/db_sync_configs sync_config_folder=~/db_sync_configs
base_config_file=$sync_config_folder/base_config.json base_config_file=$sync_config_folder/base_config.json
...@@ -63,7 +65,7 @@ elif [[ $database_name = 'dujiangyan' ]]; then ...@@ -63,7 +65,7 @@ elif [[ $database_name = 'dujiangyan' ]]; then
elif [[ $database_name = 'mall' ]]; then elif [[ $database_name = 'mall' ]]; then
# 白条商城 # 白条商城
#sys_table_list='mall_config activity_3c_product ad_detail new_3c_product supplier 3c_product 3c_product_spec apix_phone_recharge_detail apix_recharge_project apix_recharge_project_bak category configuration course_detail_info course_info merchant pay19_recharge_project mall_category product product_sku product_sku_image product_spu product_nature nature_value product_category spu_image product_nature_value goods_after_sale_step goods_after_sale_config brand advertisement_type' #sys_table_list='mall_config activity_3c_product ad_detail new_3c_product supplier 3c_product 3c_product_spec apix_phone_recharge_detail apix_recharge_project apix_recharge_project_bak category configuration course_detail_info course_info merchant pay19_recharge_project mall_category product product_sku product_sku_image product_spu product_nature nature_value product_category spu_image product_nature_value goods_after_sale_step goods_after_sale_config brand advertisement_type'
sys_table_list = 'activity_3c_product ad_detail admin_banner advertisement_type album app_channel app_channel_ad app_name app_name_ad category_banner category_nature commodity_slogan commodity_slogan_product configuration edx_city faster_entrance faster_entrance_image goods_after_sale_config goods_after_sale_step home_config home_page hot_category jd_address jd_after_sale_config jd_brand jd_category jd_product_sku_image jd_property jd_sku jd_sku_detail_image jd_sku_specs life_faster_entrance life_service mall_category mall_config merchant nature_value new_3c_product product product_category product_nature product_nature_value_bak product_sku product_sku_image product_specification product_spu recommend_brand recommend_product sale_product_detail sale_product_theme spu_image supplier tab_navigate title_banner' sys_table_list='activity_3c_product ad_detail admin_banner advertisement_type album app_channel app_channel_ad app_name app_name_ad category_banner category_nature commodity_slogan commodity_slogan_product configuration edx_city faster_entrance faster_entrance_image goods_after_sale_config goods_after_sale_step home_config home_page hot_category jd_address jd_after_sale_config jd_brand jd_category jd_product_sku_image jd_property jd_sku jd_sku_detail_image jd_sku_specs life_faster_entrance life_service mall_category mall_config merchant nature_value new_3c_product product product_category product_nature product_nature_value_bak product_sku product_sku_image product_specification product_spu recommend_brand recommend_product sale_product_detail sale_product_theme spu_image supplier tab_navigate title_banner'
port='3310' port='3310'
elif [[ $database_name = 'qinqiong' ]]; then elif [[ $database_name = 'qinqiong' ]]; then
# qinqiong # qinqiong
......
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
source ~/.bash_profile source ~/.bash_profile
source ~/.profile source ~/.profile
if [ $# -ne 9 ]; then if [ $# -ne 10 ]; then
echo "---------------" echo "---------------"
echo "source_db_infos:source_db_host: $1, source_db_user: $2" echo "source_db_infos:source_db_host: $1, source_db_user: $2"
echo "target_db_infos:target_db_host: $4, target_db_user: $5" echo "target_db_infos:target_db_host: $4, target_db_user: $5"
echo "sync_db_name: $7, re_replace_ip: $8" echo "sync_db_name: $7, re_replace_ip: $8"
echo "delete_business_data: $9" echo "delete_business_data: $9"
echo "run_sql_file : $10"
echo "---参数不正确---" echo "---参数不正确---"
echo "Usage:sh db_schema_sync.sh source_db_host source_db_user source_db_pwd target_db_host target_db_user target_db_pwd sync_db_name" echo "Usage:sh db_schema_sync.sh source_db_host source_db_user source_db_pwd target_db_host target_db_user target_db_pwd sync_db_name"
echo "---------------" echo "---------------"
...@@ -34,6 +35,7 @@ target_db_pwd=$6 ...@@ -34,6 +35,7 @@ target_db_pwd=$6
sync_db_name=$7 sync_db_name=$7
re_replace_ip=$8 re_replace_ip=$8
delete_business_data=$9 delete_business_data=$9
run_sql_file=$10
work_dir=/home/qa-deploy-utils/db-utils work_dir=/home/qa-deploy-utils/db-utils
sync_config_folder=~/db_sync_configs sync_config_folder=~/db_sync_configs
...@@ -87,8 +89,14 @@ then ...@@ -87,8 +89,14 @@ then
db_schema_sync $db_name db_schema_sync $db_name
echo $db_name echo $db_name
done done
run_sql_file
if [ $run_sql_file = true ]; then
run_sql_file
fi
else else
db_schema_sync $sync_db_name db_schema_sync $sync_db_name
run_sql_file
if [ $run_sql_file = true ]; then
run_sql_file
fi
fi 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