Files
posthog/docker/postgres-init-scripts/create-agent-runtime-queue-db.sh
d436e803b9 feat(agent-platform): core Agent Platform feature branch (all agent platform services) (#63988)
Co-authored-by: mendral-app[bot] <233154221+mendral-app[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: tests-posthog[bot] <250237707+tests-posthog[bot]@users.noreply.github.com>
Co-authored-by: dmarticus <dylan@posthog.com>
2026-06-17 15:37:12 +00:00

17 lines
584 B
Bash
Executable File

#!/bin/bash
set -e
set -u
echo "Checking if database 'agent_runtime_queue' exists..."
DB_EXISTS=$(psql -U "$POSTGRES_USER" -tAc "SELECT 1 FROM pg_database WHERE datname='agent_runtime_queue'")
if [ -z "$DB_EXISTS" ]; then
echo "Creating database 'agent_runtime_queue'..."
psql -U "$POSTGRES_USER" -c "CREATE DATABASE agent_runtime_queue;"
psql -U "$POSTGRES_USER" -c "GRANT ALL PRIVILEGES ON DATABASE agent_runtime_queue TO $POSTGRES_USER;"
echo "Database 'agent_runtime_queue' created successfully"
else
echo "Database 'agent_runtime_queue' already exists"
fi