mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 22:13:39 +09:00
Automatic checkpoint created by Claude Code - Branch: main - Timestamp: 2026-01-17T20:40:57Z - Changes: 10 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
60 lines
1.6 KiB
Bash
Executable File
60 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Run RuVector PostgreSQL migrations
|
|
|
|
set -e
|
|
|
|
HOST="${PGHOST:-localhost}"
|
|
PORT="${PGPORT:-5432}"
|
|
DATABASE="${PGDATABASE:-claude_flow}"
|
|
USER="${PGUSER:-claude}"
|
|
PASSWORD="${PGPASSWORD:-claude-flow-test}"
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
MIGRATIONS_DIR="$PROJECT_ROOT/v3/@claude-flow/plugins/src/integrations/ruvector/migrations"
|
|
|
|
echo "🚀 Running RuVector PostgreSQL Migrations"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Host: $HOST:$PORT"
|
|
echo "Database: $DATABASE"
|
|
echo "User: $USER"
|
|
echo "Migrations: $MIGRATIONS_DIR"
|
|
echo ""
|
|
|
|
# Check if migrations directory exists
|
|
if [ ! -d "$MIGRATIONS_DIR" ]; then
|
|
echo "❌ Migrations directory not found: $MIGRATIONS_DIR"
|
|
echo ""
|
|
echo "Trying to use CLI instead..."
|
|
npx claude-flow@alpha ruvector migrate \
|
|
--host $HOST \
|
|
--port $PORT \
|
|
--database $DATABASE \
|
|
--user $USER \
|
|
--up
|
|
exit $?
|
|
fi
|
|
|
|
# Run each migration in order
|
|
for migration in $(ls -1 "$MIGRATIONS_DIR"/*.sql 2>/dev/null | sort); do
|
|
filename=$(basename "$migration")
|
|
echo "📄 Running: $filename"
|
|
|
|
PGPASSWORD=$PASSWORD psql -h $HOST -p $PORT -U $USER -d $DATABASE -f "$migration" 2>&1 | \
|
|
grep -v "^$" | while read line; do
|
|
echo " $line"
|
|
done
|
|
|
|
if [ ${PIPESTATUS[0]} -eq 0 ]; then
|
|
echo " ✅ Complete"
|
|
else
|
|
echo " ❌ Failed"
|
|
exit 1
|
|
fi
|
|
echo ""
|
|
done
|
|
|
|
echo "=========================================="
|
|
echo "✅ All migrations complete!"
|