Skip to content

Instantly share code, notes, and snippets.

@keklikhasan
Created July 25, 2018 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keklikhasan/8bc48365855448102b0ea26b7cacb096 to your computer and use it in GitHub Desktop.
Save keklikhasan/8bc48365855448102b0ea26b7cacb096 to your computer and use it in GitHub Desktop.
document your database via schemaspy http://schemaspy.org/
#!/bin/bash
dt=$(date "+%Y_%m_%d_%H_%M_%s")
echo $dt
folder="[PATH]/schmaspy"
if [ -d "$folder" ]; then
mv "$folder" "${folder}_backup_$dt"
fi
mkdir "$folder"
# for more info http://schemaspy.org/
docker run -v "$folder:/output" schemaspy/schemaspy:snapshot -hq -t pgsql -u postgres -db postgres -host host.docker.internal -port 5432 -all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment