diff --git a/backend/services/deploy-mining.sh b/backend/services/deploy-mining.sh index defb2bb5..8fad73a6 100755 --- a/backend/services/deploy-mining.sh +++ b/backend/services/deploy-mining.sh @@ -777,13 +777,15 @@ cdc_resnapshot() { fi done - # Clear processed_cdc_events table + # Clear processed_cdc_events tables in all CDC consumer databases log_step "Clearing processed CDC events..." - if run_psql "rwa_contribution" "TRUNCATE TABLE processed_cdc_events;" 2>/dev/null; then - log_success "Truncated processed_cdc_events in rwa_contribution" - else - log_warn "Could not truncate processed_cdc_events (table may not exist)" - fi + for db in "rwa_contribution" "rwa_auth"; do + if run_psql "$db" "TRUNCATE TABLE processed_cdc_events;" 2>/dev/null; then + log_success "Truncated processed_cdc_events in $db" + else + log_warn "Could not truncate processed_cdc_events in $db (table may not exist)" + fi + done # For each CDC Postgres connector, save config, delete, and recreate log_step "Re-creating CDC Postgres connectors..."