Fix early ClickHouse 25.x TTL and boolean compatibility

GitLab documents support for ClickHouse 25.x, but local testing exposed two compatibility failures:

  • TTL expressions: Early 25.x releases reject TTL expressions returning DateTime64 with BAD_TTL_EXPRESSION. This affects siphon_internal_events, query_log_usage, and merge_requests_base.
  • Boolean results: ClickHouse 25.1 returns boolean values as 0/1. Ruby treats 0 as truthy, causing false aggregation dimensions such as createdByDuo to appear as true in GraphQL.

The existing 25.x CI configuration uses 25.12.3 and missed these failures. No affected customer is known.

Scope and acceptance criteria

  • Correct the original TTL migrations and add forward migrations for existing installations.
  • Preserve stored column types, retention periods, and rows. Avoid background TTL mutations and retain compatible expressions on rollback.
  • Normalize aggregation boolean results while preserving nil and custom formatters.
  • Regenerate the ClickHouse schema and cache.
  • Run the existing 25.x CI jobs on 25.1.8.25 and retain 26.x coverage.

Validation

Local implementation and checks are complete:

  • 25.1: Fresh migrations, 466 selected ClickHouse examples, and 148 GraphQL examples passed.
  • 25.12: 20 affected database examples and 45 merge-request GraphQL examples passed.
  • Upgrade tests preserved rows without creating mutations. Boolean unit tests and lint passed.

Remote CI remains pending.

References

Edited by 🤖 GitLab Bot 🤖