0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00
posthog/rust/bin/migrate-cyclotron
Michael Matloka 456466b59c
feat(max): Use new "Product description" project setting (#25937)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-04 16:34:24 +00:00

15 lines
587 B
Bash
Executable File

#!/bin/sh
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
CYCLOTRON_DATABASE_NAME=${CYCLOTRON_DATABASE_NAME:-cyclotron}
CYCLOTRON_DATABASE_URL=${CYCLOTRON_DATABASE_URL:-postgres://posthog:posthog@localhost:5432/$CYCLOTRON_DATABASE_NAME}
echo "Performing cyclotron migrations for $CYCLOTRON_DATABASE_URL (DATABASE_NAME=$CYCLOTRON_DATABASE_NAME)"
cd $SCRIPT_DIR/..
cargo install sqlx-cli@0.7.3 --locked --no-default-features --features native-tls,postgres
sqlx database create -D "$CYCLOTRON_DATABASE_URL"
sqlx migrate run -D "$CYCLOTRON_DATABASE_URL" --source cyclotron-core/migrations/