I’m trying to create a foreign_key
relationship in my model .yml file, but I’m unsure how the syntax for the expression works - I have the primary_keys
working… how do I add the right variables for… “<other_model_schema>” etc.
# column-level constraints
constraints:
- type: not_null
- type: unique
- type: foreign_key
expression: <other_model_schema>.<other_model_name> (<other_model_column>)
- type: ...
And this is what my setup looks like so far:
- name: org_ancestors
config:
contract:
enforced: true
columns:
- name: org_id
data_type: varchar(256)
constraints:
- type: foreign_key
expression: dev_brian.orgs (org_id)
Error:
yntax error line 4 at position 36 unexpected 'orgs'.
syntax error line 4 at position 41 unexpected '('.
syntax error line 5 at position 13 unexpected 'varchar'.
syntax error line 5 at position 20 unexpected '('.