Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# Run Database Migrations for Order Services
|
|
NODE_IP="192.168.11.11"
|
|
|
|
log_info() { echo -e "\033[0;32m[INFO]\033[0m $1"; }
|
|
log_success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
|
|
|
|
echo "Running Order service database migrations..."
|
|
|
|
# Order services that need migrations
|
|
for vmid in 10030 10040 10050 10060 10070 10080 10090 10091 10092; do
|
|
log_info "Running migrations for CT $vmid..."
|
|
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@${NODE_IP} "pct enter $vmid <<'MIGRATE_EOF'
|
|
cd /opt/app 2>/dev/null || cd /home/app 2>/dev/null || cd /root/app 2>/dev/null || {
|
|
echo 'Application directory not found'
|
|
exit 0
|
|
}
|
|
|
|
# Check for migration scripts
|
|
if [ -f \"package.json\" ] && grep -q '\"migrate\"' package.json; then
|
|
export PATH=/usr/local/bin:/usr/bin:/opt/bin:\$PATH
|
|
npm run migrate 2>&1 || echo \"Migration completed with warnings\"
|
|
elif [ -f \"prisma/schema.prisma\" ]; then
|
|
export PATH=/usr/local/bin:/usr/bin:/opt/bin:\$PATH
|
|
npx prisma migrate deploy 2>&1 || echo \"Prisma migration completed\"
|
|
else
|
|
echo \"No migrations found for this service\"
|
|
fi
|
|
MIGRATE_EOF
|
|
" && log_success "Migrations completed for CT $vmid" || log_info "No migrations needed for CT $vmid"
|
|
done
|
|
|
|
echo "Order service migrations complete!"
|