From cc24b191352373780c02dc6d84e05a1e7b236428 Mon Sep 17 00:00:00 2001 From: defiQUG Date: Mon, 2 Mar 2026 13:22:58 -0800 Subject: [PATCH] chore: enhance token-aggregation instructions in apply-remaining-operator-fixes.sh - Updated the script to provide a conditional execution path for applying the token-aggregation fix. - Improved instructions for creating the database and running migrations, accommodating different PostgreSQL user contexts. Made-with: Cursor --- scripts/apply-remaining-operator-fixes.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/apply-remaining-operator-fixes.sh b/scripts/apply-remaining-operator-fixes.sh index e8040ae..6f32773 100755 --- a/scripts/apply-remaining-operator-fixes.sh +++ b/scripts/apply-remaining-operator-fixes.sh @@ -65,14 +65,19 @@ else echo "" fi -# 2) Token-aggregation (steps only unless we add automation) +# 2) Token-aggregation if [[ "$NGINX_ONLY" != true ]]; then echo "--- 2. Token-aggregation (see ยง2 in DETAILED_GAPS) ---" - echo " If /health returns 'database token_aggregation does not exist':" - echo " 1) On VMID 5000 (or PostgreSQL host): createdb -U postgres token_aggregation" - echo " 2) Run migrations: cd smom-dbis-138/services/token-aggregation && DATABASE_URL=postgresql://... bash scripts/run-migrations.sh" - echo " 3) Restart: systemctl restart token-aggregation" - echo " 4) Verify: curl -s http://192.168.11.140:3001/health | jq ." + if [[ -x "$SCRIPT_DIR/apply-token-aggregation-fix.sh" ]]; then + echo " Run: ./scripts/apply-token-aggregation-fix.sh # create DB, migrations, restart via Proxmox" + echo " (VMID 5000 may need postgres user; if not, run createdb/migrations where PostgreSQL runs.)" + else + echo " If /health returns 'database token_aggregation does not exist':" + echo " 1) On VMID 5000 (or PostgreSQL host): createdb -U postgres token_aggregation" + echo " 2) Run migrations: cd smom-dbis-138/services/token-aggregation && DATABASE_URL=postgresql://... bash scripts/run-migrations.sh" + echo " 3) Restart: systemctl restart token-aggregation" + echo " 4) Verify: curl -s http://192.168.11.140:3001/health | jq ." + fi echo "" fi