mirror: chlift_e2e
database: chlift
publication: chlift_e2e_pub
tables:
    - source: public.user_events
      target: user_events
      rows: 400000
      size_bytes: 93773824
      primary_key:
        - id
      time_column: event_time
      time_type: timestamp with time zone
      order_by:
        - account_id
        - event_time
        - id
      partition_by: toYYYYMM(event_time)
      mutated: false
      notes:
        - 'sort key and partitioning cannot change after the table is created (PeerDB #4604): review them now'
        - 'needs REPLICA IDENTITY FULL: its sort key starts with account_id, and a DELETE (retention cleanup included) would otherwise leave the row live in ClickHouse'
    - source: public.request_logs
      target: request_logs
      rows: 200000
      size_bytes: 27828224
      primary_key:
        - id
      time_column: created_at
      time_type: timestamp with time zone
      order_by:
        - account_id
        - created_at
        - id
      partition_by: toYYYYMM(created_at)
      mutated: false
      notes:
        - 'sort key and partitioning cannot change after the table is created (PeerDB #4604): review them now'
        - 'needs REPLICA IDENTITY FULL: its sort key starts with account_id, and a DELETE (retention cleanup included) would otherwise leave the row live in ClickHouse'
    - source: public.system_logs
      target: system_logs
      rows: 100000
      size_bytes: 15163392
      primary_key:
        - id
      time_column: logged_at
      time_type: timestamp without time zone
      order_by:
        - logged_at
        - id
      partition_by: toYYYYMM(logged_at)
      mutated: false
      notes:
        - 'sort key and partitioning cannot change after the table is created (PeerDB #4604): review them now'
        - 'needs REPLICA IDENTITY FULL: its sort key starts with logged_at, and a DELETE (retention cleanup included) would otherwise leave the row live in ClickHouse'
skipped:
    - table: public.users
      reason: 20000 rows < --min-rows 100000
    - table: public.accounts
      reason: 500 rows < --min-rows 100000
postgres_fixes:
    - ALTER TABLE "public"."user_events" REPLICA IDENTITY FULL
    - ALTER TABLE "public"."request_logs" REPLICA IDENTITY FULL
    - ALTER TABLE "public"."system_logs" REPLICA IDENTITY FULL
    - CREATE PUBLICATION chlift_e2e_pub FOR TABLE "public"."user_events", "public"."request_logs", "public"."system_logs"
