export.sh 1.0 KB

12345678910111213141516171819
  1. #!/bin/bash
  2. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  3. cd $SCRIPT_PATH
  4. source ../.env
  5. DOCKER_COMPOSE="docker-compose -f ../docker-compose.yml"
  6. echo "Exporting video views..."
  7. $DOCKER_COMPOSE exec orion_db psql -p ${DB_PORT} -U postgres -d ${DB_NAME} -c "\copy processor.video_view_event to '/persisted_data/video_view_event' csv;"
  8. echo "Exporting channel follows..."
  9. $DOCKER_COMPOSE exec orion_db psql -p ${DB_PORT} -U postgres -d ${DB_NAME} -c "\copy processor.channel_follow to '/persisted_data/channel_follow' csv;"
  10. echo "Exporting reports..."
  11. $DOCKER_COMPOSE exec orion_db psql -p ${DB_PORT} -U postgres -d ${DB_NAME} -c "\copy processor.report to '/persisted_data/report' csv;"
  12. echo "Exporting gateway config..."
  13. $DOCKER_COMPOSE exec orion_db psql -p ${DB_PORT} -U postgres -d ${DB_NAME} -c "\copy gateway_config to '/persisted_data/gateway_config' csv;"
  14. echo "Exporting NFT featuring requests..."
  15. $DOCKER_COMPOSE exec orion_db psql -p ${DB_PORT} -U postgres -d ${DB_NAME} -c "\copy processor.nft_featuring_request to '/persisted_data/nft_featuring_request' csv;"