aboutsummaryrefslogtreecommitdiffstats
path: root/generate_db_docs.sh
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-07-21 05:36:02 +0000
committerterminaldweller <thabogre@gmail.com>2022-07-21 05:36:02 +0000
commit85db7c5287ae58efc108263f7a40bdbd02de1a82 (patch)
tree8292d90db8999dabc2e3872ea75547cb7fcf0c2d /generate_db_docs.sh
parentchanged the max doc size to 40K characters.255 was not enough... (diff)
downloadmdrtl-85db7c5287ae58efc108263f7a40bdbd02de1a82.tar.gz
mdrtl-85db7c5287ae58efc108263f7a40bdbd02de1a82.zip
added docs for the db using schemaspy
Diffstat (limited to '')
-rwxr-xr-xgenerate_db_docs.sh34
1 files changed, 34 insertions, 0 deletions
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