Skip to content

Commit

Permalink
Corrected syntax for defining the foreign key reference model using r…
Browse files Browse the repository at this point in the history
…ef()

Code sample indicated to use `to: "{{ ref('other_model_name) }}"' which results in "Compilation error [...] 'ref' is undefined"

Using `to: ref('other_model_name')` parses correctly.
  • Loading branch information
joebloomreach authored Oct 9, 2024
1 parent 49060fe commit f63cc09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/docs/reference/resource-properties/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ models:
columns: [first_column, second_column, ...]
- type: foreign_key # multi_column
columns: [first_column, second_column, ...]
to: "{{ ref('other_model_name') }}"
to: ref('other_model_name')
to_columns: [other_model_first_column, other_model_second_columns, ...]
- type: check
columns: [first_column, second_column, ...]
Expand All @@ -64,7 +64,7 @@ models:
- type: not_null
- type: unique
- type: foreign_key
to: "{{ ref('other_model_name') }}"
to: ref('other_model_name')
to_columns: other_model_column
- type: ...
```
Expand Down

0 comments on commit f63cc09

Please sign in to comment.