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

Composite PK Support #62

Open
ptyork opened this issue Sep 8, 2024 · 2 comments
Open

Composite PK Support #62

ptyork opened this issue Sep 8, 2024 · 2 comments

Comments

@ptyork
Copy link

ptyork commented Sep 8, 2024

DBDiagram.io supports both a documented and an undocumented way of specifying composite primary keys.

Documented:

Table CourseSection {
    Year char(4)
    SemesterCode char(2)
    SectionCode char(2)
    CoursePrefix char(4) [ref: > Course.CoursePrefix]
    CourseNumber char(4) [ref: > Course.CourseNumber]
    InstructorID char(9) [ref: > Faculty.EmployeeID]
    RoomCode char(10) [ref: > Room.RoomCode]
    Indexes {
        (Year,SemesterCode,SectionCode,CoursePrefix,CourseNumber) [pk]
    }
}

Undocumented:

Table CourseSection {
    Year char(4) [pk]
    SemesterCode char(2) [pk]
    SectionCode char(2) [pk]
    CoursePrefix char(4) [pk, ref: > Course.CoursePrefix]
    CourseNumber char(4) [pk, ref: > Course.CourseNumber]
    InstructorID char(9) [ref: > Faculty.EmployeeID]
    RoomCode char(10) [ref: > Room.RoomCode]
}

Supporting the documented way would be a high-priority request given how common this scenario is...though obviously a 5-part key is an abomination that I'm using as an anti-pattern in a lecture. The undocumented way is quite nice for beginners.

Thanks!

PS - if you have no time but can process PR's, I will take a stab at my outstanding feature and bug reports.

@BOCOVO
Copy link
Owner

BOCOVO commented Sep 9, 2024

Hello @ptyork !

Thank you for highlighting this issue.

Regarding your offer to help with PRs, I really appreciate it! If you're able to work on your outstanding feature and bug reports, that would be fantastic. I’ll make sure to review and process any PRs you submit as soon as I can and release them.

Thanks again for your contributions.

@BOCOVO
Copy link
Owner

BOCOVO commented Sep 22, 2024

Hello @ptyork !

Just to ask if you are working on the outstanding features and bug reports.
There are a few I can work on quickly.

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

No branches or pull requests

2 participants