initial working version
This commit is contained in:
23
wishlist-app/scripts/docker-migrate.sh
Executable file
23
wishlist-app/scripts/docker-migrate.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user