From 2b20feeefc393e1f4a48834b5450469cf1509813 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 8 Mar 2026 23:44:58 -0500 Subject: [PATCH] Add quick migration shell script --- migrate-now.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 migrate-now.sh diff --git a/migrate-now.sh b/migrate-now.sh new file mode 100644 index 0000000..647723b --- /dev/null +++ b/migrate-now.sh @@ -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 \ No newline at end of file