-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrate.sh
More file actions
executable file
·43 lines (33 loc) · 979 Bytes
/
migrate.sh
File metadata and controls
executable file
·43 lines (33 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Database migration helper script
# Runs migrations for local development
echo "🔄 Database Migration Script"
echo "============================"
echo ""
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ Warning: .env file not found!"
echo " Make sure DATABASE_URL is set in your environment"
echo ""
fi
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "❌ uv is not installed!"
echo "📝 Install it with: curl -LsSf https://astral.sh/uv/install.sh | sh"
exit 1
fi
echo "🚀 Running database migrations..."
echo ""
# Run the migration script
uv run python migrate.py
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo ""
echo "✅ Migration completed successfully!"
echo " You can now start the application with: ./run_api.sh"
else
echo ""
echo "❌ Migration failed with exit code $exit_code"
echo " Check the error messages above for details"
fi
exit $exit_code