From 7dd3fc81fd48e5b72c7f7b3c090dea9f65553fe2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 16 Apr 2018 16:46:41 +0200 Subject: bin/check-db-structure: new to dump the structure of the database --- bin/check-db-structure | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bin/check-db-structure (limited to 'bin') diff --git a/bin/check-db-structure b/bin/check-db-structure new file mode 100755 index 0000000..f0cdf89 --- /dev/null +++ b/bin/check-db-structure @@ -0,0 +1,19 @@ +#!/bin/sh + +# shellcheck source=../conf/default.conf +. "${0%/*}/../conf/default.conf" + +# shellcheck disable=SC2016 +{ + printf 'SELECT `proc`.`name` FROM `mysql`.`proc` WHERE `proc`.`Db`="buildmaster"' | \ + mysql_run_query | \ + while read -r procedure; do + printf 'SHOW CREATE PROCEDURE `%s`;\n' "${procedure}" + done + printf 'SHOW TABLES' | \ + mysql_run_query | \ + while read -r table; do + printf 'SHOW CREATE TABLE `%s`;\n' "${table}" + done +} | \ + mysql_run_query -- cgit v1.2.3-70-g09d2