From ecca1ad47db8492d5578a8d6f914331a12929374 Mon Sep 17 00:00:00 2001 From: Himanshu Agrawal Date: Wed, 25 Nov 2026 19:25:34 +0530 Subject: [PATCH] docs: show how to refresh time-based SCD history Signed-off-by: Himanshu Agrawal --- docs/concepts/models/model_kinds.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/concepts/models/model_kinds.md b/docs/concepts/models/model_kinds.md index cde104790a..f8519bdee2 100644 --- a/docs/concepts/models/model_kinds.md +++ b/docs/concepts/models/model_kinds.md @@ -974,6 +974,21 @@ TABLE db.menu_items ( ); ``` +After the initial plan has been applied, use `sqlmesh run` to process the next +eligible interval when the source data changes. A source data change does not +require another model plan. Update the source's `updated_at` value when a +record changes so the model can track the new version. + +For example, suppose a source row for ID 1 has an `updated_at` of +`2025-01-01 09:00:00` on the initial run. Update that row's non-key data and set +its `updated_at` to `2025-01-02 12:00:00` before the next run. After that run, +querying the timestamp columns for ID 1 shows both versions: + +| updated_at | valid_to | +| --- | --- | +| 2025-01-01 09:00:00 | 2025-01-02 12:00:00 | +| 2025-01-02 12:00:00 | NULL | + The `updated_at` column name can also be changed by adding the following to your model definition: ```sql linenums="1" hl_lines="5" MODEL (