From 85db7c5287ae58efc108263f7a40bdbd02de1a82 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Thu, 21 Jul 2022 10:06:02 +0430 Subject: added docs for the db using schemaspy --- generate_db_docs.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 generate_db_docs.sh (limited to 'generate_db_docs.sh') diff --git a/generate_db_docs.sh b/generate_db_docs.sh new file mode 100755 index 0000000..d65a941 --- /dev/null +++ b/generate_db_docs.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh + +JDBC_DRIVER=postgresql-42.4.0.jar +SCHEMA_SPY=schemaspy-6.1.0.jar +if [ ! -f ${JDBC_DRIVER} ]; then + # https://jdbc.postgresql.org/download.html + wget https://jdbc.postgresql.org/download/postgresql-42.4.0.jar +fi +if [ ! -f ${SCHEMA_SPY} ]; then + wget https://github.com/schemaspy/schemaspy/releases/download/v6.1.0/schemaspy-6.1.0.jar +fi + +# the driver included with the docker image is too old +# docker run \ +# -v "${PWD}"/dbdocs:/output \ +# schemaspy/schemaspy:6.1.0 \ +# -u "$(cat ./postgres/pg_user_secret)" \ +# -db "$(cat ./postgres/pg_db_secret)" \ +# -t pgsql \ +# -host 192.168.1.103 \ +# -p "$(cat ./postgres/pg_pass_secret)" \ +# -port 5432 \ +# -s public + +java -jar ${SCHEMA_SPY} \ + -o "${PWD}/dbdocs" \ + -u "$(cat ./postgres/pg_user_secret)" \ + -db "$(cat ./postgres/pg_db_secret)" \ + -t pgsql \ + -host 192.168.1.103 \ + -p "$(cat ./postgres/pg_pass_secret)" \ + -port 5432 \ + -dp . \ + -noviews -- cgit v1.2.3