Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Foreign key constraints support to (with ref) + to_columns #5983

Closed
1 task done
jtcohen6 opened this issue Aug 28, 2024 · 1 comment · Fixed by #6189
Closed
1 task done

[Core] Foreign key constraints support to (with ref) + to_columns #5983

jtcohen6 opened this issue Aug 28, 2024 · 1 comment · Fixed by #6189
Assignees
Labels
content Improvements or additions to content dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows

Comments

@jtcohen6
Copy link
Collaborator

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

https://docs.getdbt.com/reference/resource-properties/constraints

What part(s) of the page would you like to see updated?

Copied from dbt-labs/dbt-core#10414 (comment)

Model-level constraint example syntax:

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

Column-level example syntax:

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]

Additional information

This is already available in dbt Cloud Versionless

This will be available in dbt Core (OSS) v1.9

@jtcohen6 jtcohen6 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Aug 28, 2024
@graciegoheen graciegoheen added the priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows label Aug 28, 2024
@mirnawong1 mirnawong1 mentioned this issue Sep 13, 2024
3 tasks
@nghi-ly nghi-ly changed the title Foreign key constraints support to (with ref) + to_columns [Core] Foreign key constraints support to (with ref) + to_columns Sep 13, 2024
@nataliefiann
Copy link
Contributor

nataliefiann commented Sep 16, 2024

Hiya @jtcohen6 / @MichelleArk

I hope you're well.

Just so I have an understanding here, can you let me know what you'd like updating on this please? Would it be just to add the example syntaxes to the doc: https://docs.getdbt.com/reference/resource-properties/constraints

Kind Regards
Natalie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear priority: high Technical inaccuracy, missing/incorrect information, or broken links. Negatively affects workflows
Projects
None yet
5 participants