From ecca1ad47db8492d5578a8d6f914331a12929374 Mon Sep 17 00:00:00 2001 From: Himanshu Agrawal Date: Wed, 25 Nov 2026 19:25:34 +0530 Subject: [PATCH 1/2] 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 ( From ea06b1d7d5039dd59abd6974e5fdccd7add08785 Mon Sep 17 00:00:00 2001 From: Himanshu Agrawal Date: Sun, 6 Dec 2026 13:47:47 +0530 Subject: [PATCH 2/2] docs: clarify that updated_at must advance Signed-off-by: Himanshu Agrawal --- docs/concepts/models/model_kinds.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/concepts/models/model_kinds.md b/docs/concepts/models/model_kinds.md index f8519bdee2..500a4b767c 100644 --- a/docs/concepts/models/model_kinds.md +++ b/docs/concepts/models/model_kinds.md @@ -977,7 +977,8 @@ 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. +record changes. The new timestamp must be strictly later than the stored +timestamp for that row; an equal or earlier value does not create a 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