37 lines
1.0 KiB
Bash
37 lines
1.0 KiB
Bash
#!/bin/bash
|
|
|
|
# Quick migration script for microchip field fix
|
|
# Run this after deploying the updated code
|
|
|
|
echo "======================================================"
|
|
echo "BREEDR: Microchip Field Migration"
|
|
echo "======================================================"
|
|
echo ""
|
|
|
|
# Check if container is running
|
|
if ! docker ps | grep -q breedr; then
|
|
echo "Error: breedr container is not running"
|
|
echo "Please start the container first: docker start breedr"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Running migration inside container..."
|
|
echo ""
|
|
|
|
docker exec breedr node server/db/migrate_microchip.js
|
|
|
|
if [ $? -eq 0 ]; then
|
|
echo ""
|
|
echo "======================================================"
|
|
echo "Migration completed successfully!"
|
|
echo "======================================================"
|
|
echo ""
|
|
echo "Restarting container to apply changes..."
|
|
docker restart breedr
|
|
echo ""
|
|
echo "Done! Microchip field is now optional."
|
|
else
|
|
echo ""
|
|
echo "Migration failed. Check the error above."
|
|
exit 1
|
|
fi |