db/scripts/diff.sh
Orion Kindel 87f7a4d1d0
Some checks failed
migrate-stage / migrate-stage (push) Failing after 13s
migrate-devel / migrate-devel (push) Failing after 9s
chore: fix ci
2023-07-02 19:03:13 -05:00

26 lines
536 B
Bash
Executable File

#! /bin/bash
set -ex
source ./scripts/env.sh ./.env.schema
rev=${1:-}
head_url=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/dnim
base_url=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5433/dnim
if [[ -z "$rev" ]]; then
echo "revision to diff is required";
exit 1;
fi
docker compose up -d
./scripts/build.sh $rev
./scripts/build.sh HEAD
echo "migrate from $rev => HEAD" 1>&2
migra --unsafe $base_url $head_url || echo "migra exited with code $?. this is /probably/ fine" 1>&2
docker compose down