diff --git a/.circleci/config.yml b/.circleci/config.yml index 377ab515f1..96be8d86db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 orbs: - common: dailydotdev/common@0.0.19 + common: dailydotdev/common@0.0.20 jobs: build-app: diff --git a/.infra/clickhouse-sync.yml b/.infra/clickhouse-sync.yml index 06371869fd..214125c381 100644 --- a/.infra/clickhouse-sync.yml +++ b/.infra/clickhouse-sync.yml @@ -51,6 +51,8 @@ database.allowPublicKeyRetrieval: "true" snapshot.mode: "no_data" slot.name: "clickhouse_sync" +publication.name: "clickhouse_sync" +publication.autocreate.mode: "disabled" # offset.flush.interval.ms: The number of milliseconds to wait before flushing recent offsets to Kafka. This ensures that offsets are committed within the specified time interval. offset.flush.timeout.ms: 10000 diff --git a/src/migration/1784621038147-CreateClickHousePublication.ts b/src/migration/1784621038147-CreateClickHousePublication.ts new file mode 100644 index 0000000000..9d8c667f58 --- /dev/null +++ b/src/migration/1784621038147-CreateClickHousePublication.ts @@ -0,0 +1,23 @@ +import type { MigrationInterface, QueryRunner } from 'typeorm'; + +export class CreateClickHousePublication1784621038147 implements MigrationInterface { + name = 'CreateClickHousePublication1784621038147'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(/* sql */ ` + DROP PUBLICATION IF EXISTS "clickhouse_sync" + `); + + await queryRunner.query(/* sql */ ` + CREATE PUBLICATION "clickhouse_sync" + FOR ALL TABLES + WITH (publish_generated_columns = stored) + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(/* sql */ ` + DROP PUBLICATION IF EXISTS "clickhouse_sync" + `); + } +}