Michael-Antony's picture
feat: add migration management tools
d00a415
#!/bin/bash
echo "=========================================="
echo "Tracker Microservice Setup"
echo "=========================================="
# Check Python version
echo ""
echo "Checking Python version..."
python3 --version
# Install insightfy-utils from wheel first
echo ""
echo "Installing insightfy-utils..."
python3 -m pip install --user app/insightfy_utils-0.1.0-py3-none-any.whl
# Install dependencies
echo ""
echo "Installing dependencies..."
python3 -m pip install --user -r requirements.txt
# Check if .env exists
echo ""
if [ -f ".env" ]; then
echo "✅ .env file exists"
else
echo "⚠️ .env file not found. Creating from .env.example..."
cp .env.example .env
echo "✅ Created .env file. Please edit it with your credentials."
fi
# Run migrations
echo ""
echo "Do you want to run all database migrations now? (y/n)"
read -r response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo "Running all migrations..."
python3 run_all_migrations.py
else
echo "Skipping migrations. Run 'python3 run_all_migrations.py' when ready."
fi
echo ""
echo "=========================================="
echo "✅ Setup Complete!"
echo "=========================================="
echo ""
echo "Next steps:"
echo "1. Edit .env file with your database credentials"
echo "2. Run all migrations: python3 run_all_migrations.py"
echo " Or run individually:"
echo " - python3 migrate_attendance.py"
echo " - python3 migrate_tasks.py"
echo " - python3 migrate_task_attachments.py"
echo " - python3 migrate_location_tracking.py"
echo " - python3 migrate_geofences.py"
echo "3. Start service: python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8003 --reload"
echo "4. Or press F5 in VS Code to debug"
echo ""
echo "API Documentation: http://localhost:8003/docs"
echo "=========================================="