Schema Guard: PostgreSQL schema migration, SQL scripts and declarative YAML (MIT)
1.1K
A static sge and the psql it applies SQL files with, on Alpine - about 12 MB.
Open source, MIT: DBinvent/sge.
V1_2__init.sql) and
repeatables (R__view.sql) run as they aresge_history)Docs: dbinvent.com/sge - downloads (apt, static binary, crate).
2.3.0, ... (a version), 2.3 (its latest), latest. x86-64.
The image runs sge in /work: mount the migrations there.
It runs as the user sge, uid/gid 1000: a file sge writes there (dry_run_to)
needs /work writable by that uid - another uid: --user "$(id -u):$(id -g)".
docker run --rm -v "$PWD:/work" dbinvent/sge \
--db_url=postgres://app:[email protected]/app --source_dir=. migrate
# a config file in the same directory, a database on the same machine
docker run --rm --network host -v "$PWD:/work" dbinvent/sge -c sge.cfg migrate
docker run --rm dbinvent/sge help migrate
sge.cfg takes the options by the same names, without the --:
db_host=localhost
db_name=app
db_user=app
source_dir=.
The help and the messages are in English, Russian, and - not reviewed - French,
German, Simplified Chinese and Japanese, by LANG. A container has none of the
host's environment: pass it on with -e LANG, or name one, -e LANG=de_DE.UTF-8.
git is not in the image: a git script source (source_git) needs an image built
FROM dbinvent/sge that adds it (apk add git openssh-client).
On a YT Cluster, a migration applies to the node it runs on: run it against each node in turn.
A sample workflow - plan, approval, migrate - with this image alone: see the README.
The image has SBOM and provenance attestations - Alpine's packages and sge's crates:
docker buildx imagetools inspect dbinvent/sge --format '{{json .SBOM}}'. sge's own
CycloneDX SBOM is in the image too, /usr/share/doc/schema-guard/sbom.cdx.json.
MIT. The image carries it in /usr/share/doc/schema-guard/LICENSE. PostgreSQL's
client and Alpine are under their own licenses.
Content type
Image
Digest
sha256:1144691f8…
Size
17.3 MB
Last updated
about 22 hours ago
docker pull dbinvent/sge