Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save taufiqibrahim/ca6acec2043826848619c0df5dd62209 to your computer and use it in GitHub Desktop.
Save taufiqibrahim/ca6acec2043826848619c0df5dd62209 to your computer and use it in GitHub Desktop.
# Delete subscription
gcloud pubsub subscriptions delete mysql.inventory.products-bq-sub
# Delete topic
gcloud pubsub topics delete mysql.inventory.products
# Recreate BigQuery table (Using SQL UI)
CREATE OR REPLACE TABLE
<project_id>.<dataset>.mysql_inventory_products_no_schema (
data STRING
);
# Create topic
gcloud pubsub topics create mysql.inventory.products
# Create subscription
gcloud pubsub subscriptions create \
mysql.inventory.products-bq-sub \
--topic mysql.inventory.products \
--bigquery-table=$PROJECT_ID.$BQ_DATASET.mysql_inventory_products_no_schema
# Make sure containers is empty
docker-compose down -v
# Restart containers
docker-compose up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment