Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cluster/expected/canton-network/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
"deleteContentsOnDestroy": true,
"friendlyName": "mock_da2_scan Dataset",
"labels": {
"cluster": "mock"
"cluster": "mock",
"datastream_id": "legacy"
},
"location": "europe-west6"
},
Expand All @@ -187,8 +188,8 @@
"custom": true,
"id": "",
"inputs": {
"create": "'SPLICE_ROOT/cluster/pulumi/canton-network/bigquery-cloudsql.sh' create-pub-rep-slot \\\n --private-network-project=\"test-project\" \\\n --compute-region=\"europe-west6\" \\\n --service-account-email=\"undefined\" \\\n --schema-name=\"scan_sv_1\" \\\n --tables-to-replicate-joined=\"update_history_creates, update_history_exercises, scan_verdict_store, scan_verdict_transaction_view_store, app_activity_record_store\" \\\n --postgres-user-name=\"cnadmin\" \\\n --publication-name=\"update_history_datastream_pub\" \\\n --replication-slot-name=\"update_history_datastream_r_slot\" \\\n --replicator-user-name=\"bqdatastream\" \\\n --postgres-instance-name=\"undefined\" \\\n --scan-app-database-name=\"scan_sv_1\" \\\n --flyway-migration-to-wait-for=\"V068__app_activity_record_meta.sql\" \\\n ",
"delete": "'SPLICE_ROOT/cluster/pulumi/canton-network/bigquery-cloudsql.sh' delete-pub-rep-slot \\\n --private-network-project=\"test-project\" \\\n --compute-region=\"europe-west6\" \\\n --service-account-email=\"undefined\" \\\n --schema-name=\"scan_sv_1\" \\\n --tables-to-replicate-joined=\"update_history_creates, update_history_exercises, scan_verdict_store, scan_verdict_transaction_view_store, app_activity_record_store\" \\\n --postgres-user-name=\"cnadmin\" \\\n --publication-name=\"update_history_datastream_pub\" \\\n --replication-slot-name=\"update_history_datastream_r_slot\" \\\n --replicator-user-name=\"bqdatastream\" \\\n --postgres-instance-name=\"undefined\" \\\n --scan-app-database-name=\"scan_sv_1\" \\\n --flyway-migration-to-wait-for=\"V068__app_activity_record_meta.sql\" \\\n "
"create": "'SPLICE_ROOT/cluster/pulumi/canton-network/bigquery-cloudsql.sh' create-pub-rep-slot \\\n --private-network-project=\"undefined\" \\\n --compute-region=\"europe-west6\" \\\n --service-account-email=\"undefined\" \\\n --schema-name=\"scan_sv_1\" \\\n --tables-to-replicate-joined=\"update_history_creates, update_history_exercises, scan_verdict_store, scan_verdict_transaction_view_store, app_activity_record_store\" \\\n --postgres-user-name=\"cnadmin\" \\\n --publication-name=\"update_history_datastream_pub\" \\\n --replication-slot-name=\"update_history_datastream_r_slot\" \\\n --replicator-user-name=\"bqdatastream\" \\\n --postgres-instance-name=\"undefined\" \\\n --scan-app-database-name=\"scan_sv_1\" \\\n --flyway-migration-to-wait-for=\"V068__app_activity_record_meta.sql\" \\\n ",
"delete": "'SPLICE_ROOT/cluster/pulumi/canton-network/bigquery-cloudsql.sh' delete-pub-rep-slot \\\n --private-network-project=\"undefined\" \\\n --compute-region=\"europe-west6\" \\\n --service-account-email=\"undefined\" \\\n --schema-name=\"scan_sv_1\" \\\n --tables-to-replicate-joined=\"update_history_creates, update_history_exercises, scan_verdict_store, scan_verdict_transaction_view_store, app_activity_record_store\" \\\n --postgres-user-name=\"cnadmin\" \\\n --publication-name=\"update_history_datastream_pub\" \\\n --replication-slot-name=\"update_history_datastream_r_slot\" \\\n --replicator-user-name=\"bqdatastream\" \\\n --postgres-instance-name=\"undefined\" \\\n --scan-app-database-name=\"scan_sv_1\" \\\n --flyway-migration-to-wait-for=\"V068__app_activity_record_meta.sql\" \\\n "
},
"name": "sv-1-bqdatastream-pub-replicate-slots",
"provider": "",
Expand Down Expand Up @@ -333,7 +334,8 @@
},
"displayName": "sv-1-scan-update-history",
"labels": {
"cluster": "mock"
"cluster": "mock",
"datastream_id": "legacy"
},
"location": "europe-west6",
"sourceConfig": {
Expand Down
4 changes: 3 additions & 1 deletion cluster/pulumi/canton-network/bigquery-cloudsql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ case "$SUBCOMMAND" in
IF EXISTS (SELECT 1 FROM pg_publication WHERE pubname = '$PUBLICATION_NAME') THEN
ALTER PUBLICATION $PUBLICATION_NAME
SET TABLE $TABLES_TO_REPLICATE_JOINED;

ELSE
CREATE PUBLICATION $PUBLICATION_NAME
FOR TABLE $TABLES_TO_REPLICATE_JOINED;
FOR TABLE $TABLES_TO_REPLICATE_JOINED
WITH (publish_via_partition_root = true);
END IF;
END \$\$;
COMMIT; -- otherwise fails with "cannot create logical replication slot
Expand Down
Loading
Loading