Files
stats/packages/db/migrations/goose
Carl-Gerhard Lindesvärd cf949646eb fix(db): merging profiles
2024-09-18 23:46:38 +02:00

27 lines
543 B
Bash
Executable File

#!/bin/bash
if [ -z "$CLICKHOUSE_URL" ]; then
echo "CLICKHOUSE_URL is not set"
exit 1
fi
export GOOSE_DBSTRING=$CLICKHOUSE_URL
echo "Clickhouse migration script"
echo ""
echo "================="
echo "Selected database: $GOOSE_DBSTRING"
echo "================="
echo ""
if [ "$1" != "create" ] && [ -z "$CI" ]; then
read -p "Are you sure you want to run migrations on this database? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Migration cancelled."
exit 0
fi
fi
goose clickhouse --dir ./migrations $@