Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-deploy-utils
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qa-deploy-utils
Commits
5d3fedb0
Commit
5d3fedb0
authored
Aug 30, 2017
by
qa_quantgroup
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitabc.xyqb.com/QA/qa-deploy-utils
parents
9b552b63
adea5937
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
db_gen_config.sh
db-utils/db_gen_config.sh
+3
-1
db_schema_sync.sh
db-utils/db_schema_sync.sh
+11
-3
No files found.
db-utils/db_gen_config.sh
View file @
5d3fedb0
...
...
@@ -23,6 +23,8 @@ config_file_name=$8
db_backup_sub_folders
=
$9
port
=
""
sys_table_list
=
""
sync_config_folder
=
~/db_sync_configs
base_config_file
=
$sync_config_folder
/base_config.json
...
...
@@ -63,7 +65,7 @@ elif [[ $database_name = 'dujiangyan' ]]; 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
=
'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'
elif
[[
$database_name
=
'qinqiong'
]]
;
then
# qinqiong
...
...
db-utils/db_schema_sync.sh
View file @
5d3fedb0
...
...
@@ -10,12 +10,13 @@
source
~/.bash_profile
source
~/.profile
if
[
$#
-ne
9
]
;
then
if
[
$#
-ne
10
]
;
then
echo
"---------------"
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
"sync_db_name:
$7
, re_replace_ip:
$8
"
echo
"delete_business_data:
$9
"
echo
"run_sql_file :
$10
"
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
"---------------"
...
...
@@ -34,6 +35,7 @@ target_db_pwd=$6
sync_db_name
=
$7
re_replace_ip
=
$8
delete_business_data
=
$9
run_sql_file
=
$10
work_dir
=
/home/qa-deploy-utils/db-utils
sync_config_folder
=
~/db_sync_configs
...
...
@@ -87,8 +89,14 @@ then
db_schema_sync
$db_name
echo
$db_name
done
run_sql_file
if
[
$run_sql_file
=
true
]
;
then
run_sql_file
fi
else
db_schema_sync
$sync_db_name
run_sql_file
if
[
$run_sql_file
=
true
]
;
then
run_sql_file
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment