Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/concepts/models/model_kinds.md
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,22 @@ 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. 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
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 (
Expand Down