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>
40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Run Prisma Migrations for DBIS Services
|
|
|
|
set -euo pipefail
|
|
|
|
# Load IP configuration
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
NODE_IP="${PROXMOX_HOST_R630_01}"
|
|
|
|
log_info() { echo -e "\033[0;32m[INFO]\033[0m $1"; }
|
|
log_success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
|
|
|
|
echo "Running DBIS Prisma migrations..."
|
|
|
|
for vmid in 10150 10151; do
|
|
log_info "Running Prisma migrations for CT $vmid..."
|
|
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@${NODE_IP} "pct enter $vmid <<'MIGRATE_EOF'
|
|
cd /opt/dbis-core 2>/dev/null || cd /home/dbis-core 2>/dev/null || {
|
|
echo 'DBIS Core directory not found'
|
|
exit 0
|
|
}
|
|
|
|
export PATH=/usr/local/bin:/usr/bin:/opt/bin:\$PATH
|
|
export DATABASE_URL=\"postgresql://dbis:8cba649443f97436db43b34ab2c0e75b5cf15611bef9c099cee6fb22cc3d7771@${DBIS_POSTGRES_PRIMARY:-192.168.11.105}:5432/dbis_core\"
|
|
|
|
if [ -f \"prisma/schema.prisma\" ]; then
|
|
npx prisma migrate deploy 2>&1 || echo \"Prisma migration completed\"
|
|
npx prisma generate 2>&1 || echo \"Prisma client generated\"
|
|
else
|
|
echo \"Prisma schema not found\"
|
|
fi
|
|
MIGRATE_EOF
|
|
" && log_success "Prisma migrations completed for CT $vmid" || log_info "Migrations pending for CT $vmid"
|
|
done
|
|
|
|
echo "DBIS migrations complete!"
|