Add quick migration shell script

This commit is contained in:
2026-03-08 23:44:58 -05:00
parent 543b7d762b
commit 2b20feeefc

37
migrate-now.sh Normal file
View File

@@ -0,0 +1,37 @@
#!/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