mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-25 11:17:50 +01:00
456466b59c
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
15 lines
587 B
Bash
Executable File
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/
|