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
8b2c4696
Commit
8b2c4696
authored
Dec 24, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加外键兼容
parent
9c9e1edc
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1223 additions
and
5 deletions
+1223
-5
db_execute_sql.sh
db-utils/db_execute_sql.sh
+4
-2
db_foreign_base.sh
db-utils/db_foreign_base.sh
+16
-0
db_schema_sync.sh
db-utils/db_schema_sync.sh
+2
-3
workflow.sql
db-utils/foreign_key/workflow.sql
+1201
-0
No files found.
db-utils/db_execute_sql.sh
View file @
8b2c4696
...
...
@@ -30,6 +30,8 @@ fi
dropSQL
=
`
curl
-s
-m
5 http://qaapi.liangkebang.com/dbsync/getDropSQL?dbName
=
${
db_name
}
`
echo
"dropSQL:
${
dropSQL
}
"
echo
"mysql -h
$mysql_host
-P
$target_db_port
-uqa -pqatest
$db_name
-e
${
dropSQL
}
"
mysql
-h
$mysql_host
-P
$target_db_port
-uqa
-pqatest
$db_name
-e
"
${
dropSQL
}
"
if
[
-n
"
$dropSQL
"
]
;
then
echo
"mysql -h
$mysql_host
-P
$target_db_port
-uqa -pqatest
$db_name
-e
${
dropSQL
}
"
mysql
-h
$mysql_host
-P
$target_db_port
-uqa
-pqatest
$db_name
-e
"
${
dropSQL
}
"
fi
db-utils/db_foreign_base.sh
0 → 100644
View file @
8b2c4696
mysql_host
=
$1
db_name
=
$2
target_db_port
=
$3
sql_file_folder
=
/home/qa-deploy-utils/db-utils/foreign_key
echo
"cd
$sql_file_folder
"
cd
$sql_file_folder
if
[
-n
"
$db_name
"
]
;
then
if
[
-f
$db_name
.sql
]
;
then
echo
"exec foreign base sql"
echo
"mysql -h
$mysql_host
-P
$target_db_port
-uqa -pqatest <
$db_name
.sql"
mysql
-h
$mysql_host
-P
$target_db_port
-uqa
-pqatest
<
$db_name
.sql
else
echo
"have no
$db_name
foreign base sql"
fi
fi
\ No newline at end of file
db-utils/db_schema_sync.sh
View file @
8b2c4696
...
...
@@ -7,8 +7,7 @@
# Description: 实现数据库表结构同步
# -------------------------------------------------------------------------------
source
~/.bash_profile
source
~/.profile
# source ~/.bash_profile
pwd_path
=
"/home/qa-deploy-utils"
# if [ $# -ne 11 ]; then
...
...
@@ -102,7 +101,7 @@ function db_schema_sync()
fi
echo
"--- Step 3: sync schema:
$database
$target_db_host
---"
#sync_cmd="mss -conf ${config_file_name} -sync"
sh
$work_dir
/db_foreign_base.sh
$target_db_host
$sync_db_name
$target_db_port
echo
"mss -conf
${
config_file_name
}
-sync > /dev/null"
mss
-conf
${
config_file_name
}
-sync
>
/dev/null
echo
"mysql-schema-sync result:
$?
"
...
...
db-utils/foreign_key/workflow.sql
0 → 100644
View file @
8b2c4696
This diff is collapsed.
Click to expand it.
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