From 785726caaca9e02722a10f4e91efbf7f1a5ee64b Mon Sep 17 00:00:00 2001 From: Nick Zeng Date: Thu, 7 May 2026 12:07:17 +0800 Subject: [PATCH] add timescaledb extension migration and orders_daily_by_created continuous aggregate P22.1 of Stage 22 materialization layer infrastructure. Adds explicit CREATE EXTENSION migration so clean environments can run `migrate` end-to-end without ops manual setup, then creates the first continuous aggregate orders_daily_by_created (day-bucketed, grouped by company/platform/store) with WITH NO DATA. Five composite indexes cover the high-frequency query patterns documented in docs/data_query.md. P22.2/P22.3 will add the by-paid view, refresh policy and historical backfill on top. Co-Authored-By: Claude Opus 4.7 --- ...07_100000_enable_timescaledb_extension.php | 20 +++++++ ..._100100_create_orders_daily_by_created.php | 52 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 backend/migrations/2026_05_07_100000_enable_timescaledb_extension.php create mode 100644 backend/migrations/2026_05_07_100100_create_orders_daily_by_created.php diff --git a/backend/migrations/2026_05_07_100000_enable_timescaledb_extension.php b/backend/migrations/2026_05_07_100000_enable_timescaledb_extension.php new file mode 100644 index 0000000..134b5c5 --- /dev/null +++ b/backend/migrations/2026_05_07_100000_enable_timescaledb_extension.php @@ -0,0 +1,20 @@ +