From eca97e6985455e28961e5e022daf1f310c7aa3ab Mon Sep 17 00:00:00 2001 From: Natalie Fiann Date: Fri, 20 Sep 2024 12:04:46 +0100 Subject: [PATCH 01/42] Updated constraints doc to include the new recommended syntax --- .../resource-properties/constraints.md | 78 ++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index ff52a1fbcf4..a354702d1a5 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -11,6 +11,8 @@ Constraints require the declaration and enforcement of a model [contract](/refer **Constraints are never applied on `ephemeral` models or those materialized as `view`**. Only `table` and `incremental` models support applying and enforcing constraints. + + ## Defining constraints Constraints may be defined for a single column, or at the model level for one or more columns. As a general rule, we recommend defining single-column constraints directly on those columns. @@ -23,14 +25,10 @@ The structure of a constraint is: - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. - `columns` (model-level only): List of column names to apply the constraint over - - When using `foreign_key`, you need to specify the referenced table's schema manually. Use `{{ target.schema }}` in the `expression` field to automatically pass the schema used by the target environment. Note that later versions of dbt will have more efficient ways of handling this. For example: `expression: "{{ target.schema }}.customers(customer_id)"` - - ```yml @@ -68,9 +66,81 @@ models: - type: ... ``` +Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the new recommended syntax for defining foreign keys. This syntax leverages `ref`. For more information, refer to the section for the [forthcoming v1.9 release](/reference/resource-properties/constraints#whats-better-about-this-syntax). + + + + + + + +## Defining constraints + +Constraints may be defined for a single column, or at the model level for one or more columns. As a general rule, we recommend defining single-column constraints directly on those columns. + +If you are defining multiple `primary_key` constraints for a single model, those _must_ be defined at the model level. Defining multiple `primary_key` constraints at the column level is not supported. + +The structure of a constraint is: +- `type` (required): one of `not_null`, `unique`, `primary_key`, `foreign_key`, `check`, `custom` +- `expression`: Free text input to qualify the constraint. Required for certain constraint types, and optional for others. +- `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. +- `columns` (model-level only): List of column names to apply the constraint over + +Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the new recommended syntax for defining foreign keys. This syntax leverages `ref`. + +### What's better about this syntax? + +dbt will automatically resolve references to other models so that these references: + +- It captures dependencies. +- Works across environments. + +Here are two examples demonstrating how the new syntax is utilized: + + + +```yml + +models: + - name: my_model + constraints: + - type: foreign_key + columns: [id] + to: ref('my_model_to') | source('source', 'source_table') + to_columns: [id] + columns: + - name: id + data_type: integer + +``` + + + +```yml +models: + - name: my_model + columns: + - name: id + data_type: integer + constraints: + - type: foreign_key + to: ref('my_model_to') | source('source', 'source_table') + to_columns: [id] + +``` + + + +:::info + +The recommended syntax for defining foreign keys will be included in dbt Core v1.9 (open source) when it is released. + +::: + + ## Platform-specific support From a7c43032f51a75edae13470532c36a628427cd67 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:28:51 +0100 Subject: [PATCH 02/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index a354702d1a5..694a86dd0cf 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -95,7 +95,7 @@ dbt will automatically resolve references to other models so that these referenc - It captures dependencies. - Works across environments. -Here are two examples demonstrating how the new syntax is utilized: +Here are some examples showing how the new syntax is used: From 4ceebf56e3af067ad26608948015f5d0a61fcc86 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:29:05 +0100 Subject: [PATCH 03/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 694a86dd0cf..6d3b2836256 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -93,7 +93,7 @@ Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-clou dbt will automatically resolve references to other models so that these references: - It captures dependencies. -- Works across environments. +- Work across different environments Here are some examples showing how the new syntax is used: From 3b29db8c48bd0cb95c31173c880667e4e7aad653 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:29:30 +0100 Subject: [PATCH 04/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 6d3b2836256..7f74e7e5348 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -92,7 +92,7 @@ Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-clou dbt will automatically resolve references to other models so that these references: -- It captures dependencies. +- Capture dependencies - Work across different environments Here are some examples showing how the new syntax is used: From 147536f588ce023a0826c535ad585dc4c4c03e67 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:31:36 +0100 Subject: [PATCH 05/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 7f74e7e5348..7dc57f355d0 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -66,7 +66,7 @@ models: - type: ... ``` -Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the new recommended syntax for defining foreign keys. This syntax leverages `ref`. For more information, refer to the section for the [forthcoming v1.9 release](/reference/resource-properties/constraints#whats-better-about-this-syntax). +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [following section](/reference/resource-properties/constraints#whats-better-about-this-syntax). From 51b79062e55579bc55702df30cc97440927a067d Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:31:49 +0100 Subject: [PATCH 06/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 7dc57f355d0..301973566c3 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -86,7 +86,7 @@ The structure of a constraint is: - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. - `columns` (model-level only): List of column names to apply the constraint over -Today, in [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the new recommended syntax for defining foreign keys. This syntax leverages `ref`. +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. The recommended syntax means: ### What's better about this syntax? From c614e0e0ebed5edf0ca1725466cd087fd8e8d5d4 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:33:53 +0100 Subject: [PATCH 07/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 301973566c3..aae537b1bff 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -90,7 +90,7 @@ In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versi ### What's better about this syntax? -dbt will automatically resolve references to other models so that these references: +dbt automatically resolves references to other models, ensuring they: - Capture dependencies - Work across different environments From 4d39385226099c2c20eedea4a82cca410e307031 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:38:55 +0100 Subject: [PATCH 08/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index aae537b1bff..6fad45fa02a 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -88,7 +88,6 @@ The structure of a constraint is: In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. The recommended syntax means: -### What's better about this syntax? dbt automatically resolves references to other models, ensuring they: From 29b9f99f3a89940f28daf5f6184ed422f7c7480b Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:19:35 +0100 Subject: [PATCH 09/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 6fad45fa02a..17f8e51266f 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - - name: my_model constraints: - type: foreign_key columns: [id] From 878d3c67a681c90fd155f4acc308727495ff0ccb Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:19:46 +0100 Subject: [PATCH 10/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 17f8e51266f..9884bb2dfe4 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - constraints: - type: foreign_key columns: [id] to: ref('my_model_to') | source('source', 'source_table') From eb80fc5d29afd110f8ccfa682ea571ad765158d9 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:19:55 +0100 Subject: [PATCH 11/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 9884bb2dfe4..e85bf5242bc 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - - type: foreign_key columns: [id] to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] From 76ce5ee17ded8df245b3c50da37929384210feaf Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:20:06 +0100 Subject: [PATCH 12/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index e85bf5242bc..5f0712873e2 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - columns: [id] to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] columns: From 5fcc6922be81812ea4bb2975004ca3fc490396ec Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:20:24 +0100 Subject: [PATCH 13/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 5f0712873e2..a0ec40a8bc1 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] columns: - name: id From ce6b8c21e3bd603e997af250b2254a8dd4eba608 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:20:34 +0100 Subject: [PATCH 14/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index a0ec40a8bc1..8173b560861 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - to_columns: [id] columns: - name: id data_type: integer From 62f61dac75447e9ee4623240f2833e2e63981619 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:20:44 +0100 Subject: [PATCH 15/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 8173b560861..21d66dec886 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - columns: - name: id data_type: integer From a952ac3bd909065c0248bc6d5bde516b4b17bffd Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:20:53 +0100 Subject: [PATCH 16/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 21d66dec886..0c981ba8997 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - - name: id data_type: integer ``` From e895010c5e9b5538339f98e6f6e47839bb79a82a Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:21:02 +0100 Subject: [PATCH 17/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 0c981ba8997..abd493be523 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - data_type: integer ``` From f7737bb652b8f042e0741bb16a7fdfcfc2644ea7 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:21:15 +0100 Subject: [PATCH 18/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index abd493be523..b6115ad8f32 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - ``` From 1bec0022134d508a9f700d8d364dbffad867e599 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:21:23 +0100 Subject: [PATCH 19/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index b6115ad8f32..c0a63314455 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: -``` From 5519154f1f1ed22607703a5b36cf495e0c72c9de Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:21:33 +0100 Subject: [PATCH 20/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index c0a63314455..54967ecf284 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - From 47865272105c1ce9926e5a7e387e23cf0d92ba1c Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:21:43 +0100 Subject: [PATCH 21/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 54967ecf284..83d9d98a8f9 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,6 @@ Here are some examples showing how the new syntax is used: ```yml models: - From 214d990cf30ee4b5df753387c762178edef8e3b3 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:02 +0100 Subject: [PATCH 22/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 83d9d98a8f9..94cc49970af 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -102,7 +102,6 @@ Here are some examples showing how the new syntax is used: models: - ```yml From 3f8c49c709036e02078561f781ee78eba1c77a9f Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:11 +0100 Subject: [PATCH 23/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 94cc49970af..2e68919b123 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -102,7 +102,6 @@ Here are some examples showing how the new syntax is used: models: - ```yml models: From 406f5ae7347c22ceaf82881729c8fe00c003a22a Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:21 +0100 Subject: [PATCH 24/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 2e68919b123..e1a1514f0a1 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -102,7 +102,6 @@ Here are some examples showing how the new syntax is used: models: -```yml models: - name: my_model From 01683460a609fd3716f63e2e10d3bcbffc7d17c4 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:39 +0100 Subject: [PATCH 25/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index e1a1514f0a1..dcb9901e0c5 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: -models: - name: my_model columns: - name: id From 55863319611fac176f4e2243c951c8bfbf9db0b9 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:22:51 +0100 Subject: [PATCH 26/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index dcb9901e0c5..156ba6ed368 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - - name: my_model columns: - name: id data_type: integer From 15e4b6007ce98303ee6f927c9d00ec92c3797f16 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:23:00 +0100 Subject: [PATCH 27/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 156ba6ed368..28fca233afe 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - columns: - name: id data_type: integer constraints: From 0464cce14cabd0188e277566488c0a7f11204fab Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:23:22 +0100 Subject: [PATCH 28/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 28fca233afe..0b8d566b6d0 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - - name: id data_type: integer constraints: - type: foreign_key From 0a1d6d4314074cb62f0c38d560a3d94043ac200d Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:23:29 +0100 Subject: [PATCH 29/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 0b8d566b6d0..84add808385 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - data_type: integer constraints: - type: foreign_key to: ref('my_model_to') | source('source', 'source_table') From 6f1b97689515248dd311a17716ef63337164e21b Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:23:38 +0100 Subject: [PATCH 30/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 84add808385..6686fe915c1 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - constraints: - type: foreign_key to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] From 34e5c4f25b16eace5950153e1e548bcbaeede3df Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:23:54 +0100 Subject: [PATCH 31/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 6686fe915c1..3880f5683b3 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - - type: foreign_key to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] From 6f040ddebe23d41b15a21f7649ae49f8958ae702 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:24:03 +0100 Subject: [PATCH 32/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 3880f5683b3..403cf8f66be 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - to: ref('my_model_to') | source('source', 'source_table') to_columns: [id] ``` From ae4887df0faf151b8619795874a0f321945745dd Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:24:11 +0100 Subject: [PATCH 33/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 403cf8f66be..7eae7ab53db 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -103,7 +103,6 @@ Here are some examples showing how the new syntax is used: models: - to_columns: [id] ``` From 66b456d5fa59693d1e0af6b51361783e74e194ea Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:25:01 +0100 Subject: [PATCH 34/42] Update website/docs/reference/resource-properties/constraints.md --- .../resource-properties/constraints.md | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 7eae7ab53db..099953fc53c 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -101,7 +101,38 @@ Here are some examples showing how the new syntax is used: ```yml models: - +models: + - name: + + # required + config: + contract: + enforced: true + + # model-level constraints + constraints: + - type: primary_key + columns: [FIRST_COLUMN, SECOND_COLUMN, ...] + - type: FOREIGN_KEY # multi_column + columns: [FIRST_COLUMN, SECOND_COLUMN, ...] + expression: "OTHER_MODEL_SCHEMA.OTHER_MODEL_NAME (OTHER_MODEL_FIRST_COLUMN, OTHER_MODEL_SECOND_COLUMN, ...)" + - type: check + columns: [FIRST_COLUMN, SECOND_COLUMN, ...] + expression: "FIRST_COLUMN != SECOND_COLUMN" + name: HUMAN_FRIENDLY_NAME + - type: ... + + columns: + - name: FIRST_COLUMN + data_type: DATA_TYPE + + # column-level constraints + constraints: + - type: not_null + - type: unique + - type: foreign_key + expression: OTHER_MODEL_SCHEMA.OTHER_MODEL_NAME (OTHER_MODEL_COLUMN) + - type: ... ``` From 83c44890655068bdbada5a3ac302099f11b21870 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:40:44 +0100 Subject: [PATCH 35/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 099953fc53c..56b13b1dade 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -139,7 +139,6 @@ models: -:::info The recommended syntax for defining foreign keys will be included in dbt Core v1.9 (open source) when it is released. From 1e4cf71ec687f0350769344b1afe8c20ed0974cf Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:41:54 +0100 Subject: [PATCH 36/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 56b13b1dade..37723419f7a 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -140,7 +140,7 @@ models: -The recommended syntax for defining foreign keys will be included in dbt Core v1.9 (open source) when it is released. +In dbt Cloud Versionless, you can now use the recommended syntax for defining foreign keys. This will become available in dbt Core v1.9. ::: From 583fd26c52a5cdfd2ab203e71e36478c5805ebdf Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Fri, 20 Sep 2024 22:42:11 +0100 Subject: [PATCH 37/42] Update website/docs/reference/resource-properties/constraints.md --- website/docs/reference/resource-properties/constraints.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 37723419f7a..100fb842cff 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -142,7 +142,6 @@ models: In dbt Cloud Versionless, you can now use the recommended syntax for defining foreign keys. This will become available in dbt Core v1.9. -::: From 2d62385167e2b13bd2870d926cf287e82daadd58 Mon Sep 17 00:00:00 2001 From: Natalie Fiann Date: Mon, 23 Sep 2024 13:53:22 +0100 Subject: [PATCH 38/42] Updated constraints doc to show relevant syntax for v1.9 --- .../resource-properties/constraints.md | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 100fb842cff..416bef7b949 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -86,53 +86,46 @@ The structure of a constraint is: - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. - `columns` (model-level only): List of column names to apply the constraint over -In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. The recommended syntax means: +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. - -dbt automatically resolves references to other models, ensuring they: +The recommended syntax means dbt automatically resolves references to other models, ensuring they: - Capture dependencies - Work across different environments -Here are some examples showing how the new syntax is used: +Here's an example showing how the new syntax is used: ```yml models: -models: - - name: - - # required +name: + +# required config: contract: enforced: true - - # model-level constraints + +# Model-level constraints constraints: - - type: primary_key - columns: [FIRST_COLUMN, SECOND_COLUMN, ...] - - type: FOREIGN_KEY # multi_column - columns: [FIRST_COLUMN, SECOND_COLUMN, ...] - expression: "OTHER_MODEL_SCHEMA.OTHER_MODEL_NAME (OTHER_MODEL_FIRST_COLUMN, OTHER_MODEL_SECOND_COLUMN, ...)" - - type: check - columns: [FIRST_COLUMN, SECOND_COLUMN, ...] - expression: "FIRST_COLUMN != SECOND_COLUMN" - name: HUMAN_FRIENDLY_NAME - - type: ... + - type: foreign_key + columns: [id] + to: ref('my_model_to') # or source('source', 'source_table') + to_columns: [id] +columns: + - name: id + data_type: integer + + # Column-level definitions and constraints columns: - - name: FIRST_COLUMN - data_type: DATA_TYPE - - # column-level constraints + - name: id + data_type: integer constraints: - - type: not_null - - type: unique - type: foreign_key - expression: OTHER_MODEL_SCHEMA.OTHER_MODEL_NAME (OTHER_MODEL_COLUMN) - - type: ... + to: ref('my_model_to') # or source('source', 'source_table') + to_columns: [id] ``` From 78352d5c91a5cfe408ffbd88ce43b22df156f50b Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:45:33 +0100 Subject: [PATCH 39/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 416bef7b949..310b75fb0f2 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -93,7 +93,7 @@ The recommended syntax means dbt automatically resolves references to other mode - Capture dependencies - Work across different environments -Here's an example showing how the new syntax is used: +Here's an example showing how to use the recommended syntax: From 18eba31b4821eeaee02111d20d5994ad35cccae0 Mon Sep 17 00:00:00 2001 From: Natalie Fiann Date: Tue, 24 Sep 2024 21:03:44 +0100 Subject: [PATCH 40/42] updated doc to perfect version block --- .../resource-properties/constraints.md | 65 +++++++------------ 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 310b75fb0f2..38e2958505e 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -11,8 +11,6 @@ Constraints require the declaration and enforcement of a model [contract](/refer **Constraints are never applied on `ephemeral` models or those materialized as `view`**. Only `table` and `incremental` models support applying and enforcing constraints. - - ## Defining constraints Constraints may be defined for a single column, or at the model level for one or more columns. As a general rule, we recommend defining single-column constraints directly on those columns. @@ -23,7 +21,9 @@ The structure of a constraint is: - `type` (required): one of `not_null`, `unique`, `primary_key`, `foreign_key`, `check`, `custom` - `expression`: Free text input to qualify the constraint. Required for certain constraint types, and optional for others. - `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. -- `columns` (model-level only): List of column names to apply the constraint over +- `columns` (model-level only): List of column names to apply the constraint over. + + When using `foreign_key`, you need to specify the referenced table's schema manually. Use `{{ target.schema }}` in the `expression` field to automatically pass the schema used by the target environment. Note that later versions of dbt will have more efficient ways of handling this. @@ -66,27 +66,17 @@ models: - type: ... ``` -In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [following section](/reference/resource-properties/constraints#whats-better-about-this-syntax). - +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [following section](/reference/resource-properties/constraints#whats-better-about-this-syntax). + -## Defining constraints - -Constraints may be defined for a single column, or at the model level for one or more columns. As a general rule, we recommend defining single-column constraints directly on those columns. - -If you are defining multiple `primary_key` constraints for a single model, those _must_ be defined at the model level. Defining multiple `primary_key` constraints at the column level is not supported. - -The structure of a constraint is: -- `type` (required): one of `not_null`, `unique`, `primary_key`, `foreign_key`, `check`, `custom` -- `expression`: Free text input to qualify the constraint. Required for certain constraint types, and optional for others. -- `name` (optional): Human-friendly name for this constraint. Supported by some data platforms. -- `columns` (model-level only): List of column names to apply the constraint over +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. -In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. +#### What's better about this syntax The recommended syntax means dbt automatically resolves references to other models, ensuring they: @@ -99,43 +89,32 @@ Here's an example showing how to use the recommended syntax: ```yml -models: -name: +name: -# required - config: - contract: - enforced: true +#required +config: + contract: + enforced: true # Model-level constraints +constraints: + - type: foreign_key + columns: [id] + to: ref('my_model_to') # or source('source', 'source_table') + to_columns: [id] + +# Column-level definitions and constraints +columns: + - name: id + data_type: integer constraints: - type: foreign_key - columns: [id] to: ref('my_model_to') # or source('source', 'source_table') to_columns: [id] -columns: - - name: id - data_type: integer - - - # Column-level definitions and constraints - columns: - - name: id - data_type: integer - constraints: - - type: foreign_key - to: ref('my_model_to') # or source('source', 'source_table') - to_columns: [id] - - ``` - -In dbt Cloud Versionless, you can now use the recommended syntax for defining foreign keys. This will become available in dbt Core v1.9. - - ## Platform-specific support From 0b87eff63d655b010e19e099f4cce6f70d5d0c4d Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:53:02 +0100 Subject: [PATCH 41/42] Update constraints.md --- .../resource-properties/constraints.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index 38e2958505e..b3a9da982e2 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -68,7 +68,7 @@ models: -In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [following section](/reference/resource-properties/constraints#whats-better-about-this-syntax). +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [What's better about this syntax section](/reference/resource-properties/constraints?version=1.9.1#whats-better-about-this-syntax). @@ -88,29 +88,29 @@ Here's an example showing how to use the recommended syntax: ```yml +models: + - name: -name: - -#required -config: - contract: - enforced: true - -# Model-level constraints -constraints: - - type: foreign_key - columns: [id] - to: ref('my_model_to') # or source('source', 'source_table') - to_columns: [id] + # required + config: + contract: + enforced: true -# Column-level definitions and constraints -columns: - - name: id - data_type: integer + # Model-level constraints constraints: - type: foreign_key - to: ref('my_model_to') # or source('source', 'source_table') + columns: [id] + to: {{ ref('my_model_to') }} # or {{ source('source', 'source_table') }} to_columns: [id] + + # Column-level definitions and constraints + columns: + - name: id + data_type: integer + constraints: + - type: foreign_key + to: {{ ref('my_model_to') }} # or {{ source('source', 'source_table') }} + to_columns: [id] ``` From a7b729173e6a348b0059df134d56692735019c69 Mon Sep 17 00:00:00 2001 From: nataliefiann <120089939+nataliefiann@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:04:01 +0100 Subject: [PATCH 42/42] Update website/docs/reference/resource-properties/constraints.md Co-authored-by: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> --- website/docs/reference/resource-properties/constraints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/resource-properties/constraints.md b/website/docs/reference/resource-properties/constraints.md index b3a9da982e2..7815fc9c7f1 100644 --- a/website/docs/reference/resource-properties/constraints.md +++ b/website/docs/reference/resource-properties/constraints.md @@ -68,7 +68,7 @@ models: -In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the [What's better about this syntax section](/reference/resource-properties/constraints?version=1.9.1#whats-better-about-this-syntax). +In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the improved syntax to define foreign keys, which uses `ref`. This feature will be available in the upcoming 1.9 release. For more information, update the documentation version to 1.9 and refer to the 'What's better about this syntax' section.