Add quick migration shell script
This commit is contained in:
37
migrate-now.sh
Normal file
37
migrate-now.sh
Normal 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
|
||||||
Reference in New Issue
Block a user