24 lines
563 B
Bash
Executable File
24 lines
563 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script to run database migrations in Docker container
|
|
# Usage: ./scripts/docker-migrate.sh
|
|
|
|
echo "🔄 Running database migrations..."
|
|
|
|
# Check if container is running
|
|
if ! docker ps | grep -q wishlist-app; then
|
|
echo "❌ Error: wishlist-app container is not running"
|
|
echo " Start it with: docker-compose up -d"
|
|
exit 1
|
|
fi
|
|
|
|
# Run the migration
|
|
docker-compose exec app bun run db:push
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo "✅ Database schema updated successfully!"
|
|
else
|
|
echo "❌ Migration failed. Check the error above."
|
|
exit 1
|
|
fi
|