summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-19 10:57:40 +0200
committerErich Eckner <git@eckner.net>2018-04-19 11:00:37 +0200
commit098856d74848fedc0233aa0530015b912861238f (patch)
tree9c54b40917ef20c6fe828713cc9003d098376d9a /bin
parent89c2daf4f7979550b94e29306f46169a339db0ce (diff)
downloadbuilder-098856d74848fedc0233aa0530015b912861238f.tar.xz
bin/check-db-structure, misc/database-layout.dump: tried to make dump nicer
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check-db-structure9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/check-db-structure b/bin/check-db-structure
index c92182c..cb63c42 100755
--- a/bin/check-db-structure
+++ b/bin/check-db-structure
@@ -10,6 +10,14 @@
while read -r procedure; do
printf 'SHOW CREATE PROCEDURE `%s`;\n' "${procedure}"
done
+} | \
+ mysql_run_query | \
+ sed '
+ s/ \(SELECT\|FROM\|\(LEFT \|RIGHT \)\?JOIN\|ON\|WHERE\) /\n\t\1 /g
+ s/(SELECT/(\nSELECT/g
+ '
+# shellcheck disable=SC2016
+{
printf 'SHOW TABLES' | \
mysql_run_query | \
while read -r table; do
@@ -19,4 +27,5 @@
mysql_run_query | \
sed '
s/ AUTO_INCREMENT=[0-9]\+ / /g
+ s/^ /\t/
'