#!/usr/bin/env sh # Run on the machine that holds the validated fiscal datasets (development Hub). Exports ONLY the reference tables # (datasets + fiscal entries), never tenants/agents/jobs/classification data, so a fresh production Hub can be seeded: # # ./export_datasets_seed.sh projeto-postgres-1 > gti_datasets_seed.dump # (copy to the production host, then) ./seed_datasets.sh gti_datasets_seed.dump set -eu CONTAINER="${1:-projeto-postgres-1}" TABLES="datasets ncm_entries legacy_ncm_entries cest_entries cest_ncm_entries tipi_entries ba_st_mva_entries ba_st_mva_ncm_sh fiscal_code_entries cfop_entries fcp_rates anp_product_codes ncm_utrib_entries rtc_biofuel_index_entries rtc_cred_pres_entries rtc_cclasstrib_entries rtc_cst_ibscbs_entries rtc_cbs_rate_entries" ARGS="" for t in $TABLES; do ARGS="$ARGS -t $t"; done docker exec "$CONTAINER" pg_dump -U gti -d gti_fiscal -Fc --data-only $ARGS