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

[FR] sql_table: Support PK and FK composed by 2+ attributes #671

Open
augustozanellato opened this issue Jan 16, 2023 · 1 comment
Open

Comments

@augustozanellato
Copy link

augustozanellato commented Jan 16, 2023

At the moment d2 can't represent FKs that are composed of more than one column.
Example:

tenant: {
  shape: sql_table

  id: int {constraint: primary_key}
}

project: {
  shape: sql_table

  id: int
  tenant: int {constraint: foreign_key}
  # here i may want to have the PK defined as (id, tenant)
}

tenant.id <- project.tenant
@alixander
Copy link
Collaborator

alixander commented Feb 12, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants