Menu ▾ ▴

#156 Ship schema, not demo data: mount raw-schema.sql instead of demo-data.sql

closed
nobody
None
2026-09-12
2026-09-12
Anonymous
No

Originally created by: grynn-in

Part of removing the Contoso/Alpine demo (the Ecolab model will replace it). The konsol half, which removes the demo fixtures, follows in a separate PR.

What changes

  • clickhouse/demo-data.sql is deleted. It held 1 CREATE DATABASE, 14 CREATE TABLE epm_raw.* and 34 INSERTs of synthetic data, including rows in five konsol-owned epm_staging tables. Its credits were also unsigned (#155).
  • clickhouse/raw-schema.sql is new: just the 14 CREATE TABLEs, extracted from the old file. init-db.sql creates none of the epm_raw source tables, so without these every staging model, and the whole dbt build, fails on a missing source.
  • docker-compose.yml: initdb now mounts 02-raw-schema.sql in place of 02-demo-data.sql.
  • The deployment guide now says what a fresh volume gets. The generator's docstring says nothing loads its output.

Verification

  • raw-schema.sql ran against a throwaway database (epm_raw_ddlcheck_110, dropped afterwards): 14 tables created, and every column list is identical to live epm_raw.
  • The F8 submission tables (trial_balance_submissions, ..._control) come from init-db.sql, so they're unaffected.
  • No dbt change; dbt parse covers the rest in CI.

Not covered

ClickHouse runs initdb only against an empty volume, so existing stacks keep their demo rows until the volume is wiped. That happens with the planned reset.

🤖 Generated with Claude Code

https://claude.ai/code/session_013WewQKFQgG7o2M3mUDPRR5

Related

Tickets: #158
Tickets: #166

Discussion

  • Anonymous

    Anonymous - 2026-09-12

    Originally posted by: grynn-in

    Pre-merge checks

    This repo's CI triggers only on dbt_project/**, so no automated check ran here. Checked by hand instead:

    • Init order is safe. 01-init-db.sql and 02-raw-schema.sql both use CREATE DATABASE IF NOT EXISTS epm_raw, and init-db.sql already creates the two F8 submission tables there. A fresh volume runs both without a collision.
    • The DDL is right. raw-schema.sql ran against a throwaway database: 14 tables, and every column list is identical to live epm_raw.
    • Nothing else loads the demo. No other file mounts demo-data.sql, and .gitignore now keeps the generator's output out of the repo.
    • Pre-existing, out of scope: docker-compose.cluster.yml mounts only init-db.sql, so cluster mode has never had the raw landing tables, demo or not. Adding them there needs a decision on replicated vs local tables per shard.

    🤖 Generated with Claude Code

     
  • Anonymous

    Anonymous - 2026-09-12

    Ticket changed by: grynn-in

    • status: open --> closed
     

Log in to post a comment.