2024-09-10 09:05:30 +02:00
|
|
|
#!/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)"
|
|
|
|
|
2024-11-04 17:34:24 +01:00
|
|
|
cd $SCRIPT_DIR/..
|
|
|
|
|
|
|
|
cargo install sqlx-cli@0.7.3 --locked --no-default-features --features native-tls,postgres
|
2024-09-11 12:09:29 +02:00
|
|
|
|
2024-09-10 09:05:30 +02:00
|
|
|
sqlx database create -D "$CYCLOTRON_DATABASE_URL"
|
2024-11-04 17:34:24 +01:00
|
|
|
sqlx migrate run -D "$CYCLOTRON_DATABASE_URL" --source cyclotron-core/migrations/
|