Sqitch is maevsi's database migration tool.
The src
directory in this repository contains a sqitch
executable that you can use to interact with the migrations residing in the directory's subdirectories.
For example, run ./sqitch deploy
to fill the database with structure like tables, types and policies.
In case you want to be able to simple call sqitch deploy
without ./
instead, add an alias sqitch="./sqitch"
to your shell configuration (~/.bashrc
, ~/.zshrc
, ...).
The test
directory contains the data.patch
file that can be applied by running git apply --3way data.patch
to add basic test data to your working directory.
This diagram shows the structure of maevsi's database.
You can create this file as follows:
-
configure maevsi_stack by adding a portforward of
5432:5432
to thepostgres
service -
start
maevsi_stack
-
run
docker run -v /run/postgresql/:/run/postgresql/ --network=host --name schemacrawler --rm -i -t --user=0:0 --entrypoint=/bin/bash schemacrawler/schemacrawler
-
connect as user
schcrwlr
to the now runningschemacrawler
container, e.g. using Portainer -
as
schcrwlr
runschemacrawler --server=postgresql --database=maevsi --user=postgres --password=postgres --command=schema --info-level=maximum --output-format=png --output-file=graph.png --schemas=maevsi.*
-
as
root
install curl usingapk update && apk add curl
-
still as
root
upload the graph image by runningcurl -i -F file="@graph.png" "https://tmpfiles.org/api/v1/upload"
-
click the link in the output and download the image that pops up!