From d9b9a2f81e539357feab0d2cc2e3042c5844294c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 9 May 2018 09:48:21 +0200 Subject: bin/check-db-structure: add dump of content of "constant" tables --- bin/check-db-structure | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'bin') diff --git a/bin/check-db-structure b/bin/check-db-structure index 3b85756..5f7d9c2 100755 --- a/bin/check-db-structure +++ b/bin/check-db-structure @@ -5,6 +5,8 @@ # shellcheck source=../conf/default.conf . "${0%/*}/../conf/default.conf" +# stored functions + # shellcheck disable=SC2016 { printf 'SELECT `proc`.`name` FROM `mysql`.`proc` WHERE `proc`.`Db`="buildmaster"' | \ @@ -18,6 +20,9 @@ s/ \(SELECT\|FROM\|\(LEFT \|RIGHT \)\?JOIN\|ON\|WHERE\) /\n\t\1 /g s/(SELECT/(\nSELECT/g ' + +# table headers + # shellcheck disable=SC2016 { printf 'SHOW TABLES' | \ @@ -31,3 +36,21 @@ s/ AUTO_INCREMENT=[0-9]\+ / /g s/^ /\t/ ' + +# content of "constant" tables +mysqldump --skip-lock-tables 'buildmaster' \ + 'architectures' \ + 'dependency_types' \ + 'email_actions' \ + 'fail_reasons' \ + 'git_repositories' \ + 'repositories' \ + 'repository_moves' \ + 'repository_stabilities' \ + 'repository_stability_relations' \ + 'upstream_repositories' | \ + grep '^INSERT ' | \ + sed ' + s/),(/),\n (/g + s/VALUES (/VALUES\n (/g + ' -- cgit v1.2.3-54-g00ecf