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

Entity Relationship: new syntax to allow attribute to be PK and FK at the same time #4009

Closed
RamanDamayeu opened this issue Jan 18, 2023 · 1 comment · Fixed by #4030
Closed
Labels
Graph: Entity Relationship Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@RamanDamayeu
Copy link

Proposal

According to the documentation for Entity Relationship Diagrams we could add a key property to attributes and keys can be "PK" or "FK", for Primary Key or Foreign Key.

I would propose to add "PK/FK" or "PK,FK" to the chose as there is no restriction from modeling point of view that I know about for an attribute to play role of Primary Key and Foreign Key at the same time.

Example

In the following example CUSTOMER_STATUS.customer_number is a part of Primary Key for CUSTOMER_STATUS and also points to CUSTOMER.customer_number so plays the role of Foreign Key.

CUSTOMER {
		int customer_number PK
		string first_name
		string last_name
}

CUSTOMER ||--|{ CUSTOMER_STATUS : has_status
CUSTOMER_STATUS {
		int customer_number PK/FK
		datetime customer_status_start_datetime PK
		datetime customer_status_end_datetime
		string customer_status
}


### Screenshots

_No response_
@RamanDamayeu RamanDamayeu added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jan 18, 2023
@RamanDamayeu RamanDamayeu changed the title Entity Relationship: new syntax to allow attribute to be and PK in FK at the same time Entity Relationship: new syntax to allow attribute to be PK and FK at the same time Jan 18, 2023
@tomperr
Copy link
Contributor

tomperr commented Jan 21, 2023

Good idea, I might take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Entity Relationship Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants