Skip to content

fix(db): fold migrations 010-013 into init.sql for fresh installs - #63

Merged
cchwala merged 1 commit into
mainfrom
fix/init-sql-perf-migrations
Jul 25, 2026
Merged

fix(db): fold migrations 010-013 into init.sql for fresh installs#63
cchwala merged 1 commit into
mainfrom
fix/init-sql-perf-migrations

Conversation

@cchwala

@cchwala cchwala commented Jul 25, 2026

Copy link
Copy Markdown
Member

A fresh DB (docker compose up with an empty volume) only runs init.sql; migration files under database/migrations/ are only for upgrading already-running deployments. init.sql was not updated when migrations 010-013 were merged (#62), so a fresh install was missing:

  • idx_cml_data_user_cml_time composite index (010)
  • get_cml_aggregates() RLS-safe aggregation helper (011)
  • 1-day chunk_time_interval + matching compress_after (012)
  • idx_cml_data_covering covering index (013)

Verified by initializing a throwaway container from a clean volume and confirming the resulting schema matches (index definitions, chunk interval, compression policy config, and function signature).

A fresh DB (docker compose up with an empty volume) only runs
init.sql; migration files under database/migrations/ are only for
upgrading already-running deployments. init.sql was not updated when
migrations 010-013 were merged (#62), so a fresh install was missing:

- idx_cml_data_user_cml_time composite index (010)
- get_cml_aggregates() RLS-safe aggregation helper (011)
- 1-day chunk_time_interval + matching compress_after (012)
- idx_cml_data_covering covering index (013)

Verified by initializing a throwaway container from a clean volume
and confirming the resulting schema matches (index definitions,
chunk interval, compression policy config, and function signature).
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.59%. Comparing base (5ac61eb) to head (0492a84).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   86.10%   87.59%   +1.48%     
==========================================
  Files          39       35       -4     
  Lines        3418     3038     -380     
==========================================
- Hits         2943     2661     -282     
+ Misses        475      377      -98     
Flag Coverage Δ
mno_simulator 86.12% <ø> (ø)
parser 92.00% <ø> (ø)
scripts ?
webserver 73.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cchwala
cchwala merged commit ff803fd into main Jul 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant