gitcoinco/code_fund_ads

View on GitHub
bin/heroku_pg_dump_production_replica

Summary

Maintainability
Test Coverage
#!/usr/bin/env bash

source .env

# Requirements
# - Database environment variables
#   * METABASE_URL

if [[ -z "$METABASE_URL" ]]; then
  echo "METABASE_URL environment variable not set!"
  exit 1
fi

rm -f ./tmp/production-shallow.dump

pg_dump \
  --verbose \
  --no-acl \
  --no-owner \
  --format=c \
  --exclude-schema=hdb_catalog \
  --exclude-table='impressions_*_advertiser_*' \
  --exclude-table-data='impressions_*' \
  $METABASE_URL > ./tmp/production-shallow.dump