-
Notifications
You must be signed in to change notification settings - Fork 22
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
docs(contribution-guidelines): add database design diagrams #71
Comments
Here is what I think we had so far (this is done using mermaid): erDiagram
User {
int id "Primary key, unique"
varchar first_name "First name of the user"
varchar middle_name "Middle name of the user, optional"
varchar last_name "Last name of the user"
varchar preferred_name "Preferred name of the user, optional"
varchar email "Email of the user, must be unique, verification required"
date date_of_birth "Date of birth of the user, verification required"
enum gender "Gender of the user, e.g., male, female, etc."
enum phone_number_country_code "Country code of phone number, e.g., +1"
varchar phone_number "Phone number of the user, must be unique, verification required"
int hackathons_attended "Number of hackathons attended by the user"
longtext any_other_comments "Any additional comments from the user"
bool international_or_domestic "Whether the user is international or domestic, optional"
enum ethnicity "Ethnicity of the user, optional"
int estimated_grad_year "Estimated graduation year of the user, optional"
enum mlh_reqs "MLH requirements, default is 'No'"
int resume_id "References Resume.id, mandatory relationship"
int school_id "References School.id, mandatory relationship"
int emergency_contact_id "References EmergencyContact.id, mandatory relationship"
int team_id "References Team.id, mandatory relationship"
}
EmergencyContact {
int id "Primary key, unique"
varchar name "Name of the emergency contact"
enum relationship "Relationship to the user, e.g., mother, father, etc."
varchar phone_number "Phone number of the contact, must be unique, verification required"
bool is_verified "Whether the phone number is verified, default is 'no'"
}
Team {
int id "Primary key, unique"
varchar name "Name of the team"
varchar project_link_id "URL to the project, verification required"
int team_admin "References User.id, one-to-one relationship"
bool has_submitted "Whether the team has submitted a project, default is 'No'"
}
School {
int id "Primary key, unique"
varchar name "Name of the school, verification required"
enum level_of_study "Level of study, e.g., graduate school, high school, etc."
}
Program {
int id "Primary key, unique"
varchar name "Name of the program"
int school_id "References School.id"
enum program_type "Type of program, e.g., bachelor, master, diploma, certificate, etc."
}
Resume {
int id "Primary key, unique"
varchar file_link "URL to the resume file, verification required"
bool privacy_toggle "Privacy setting for the resume, default is false"
timestamp uploaded_at "Timestamp when the resume was uploaded, default is CURRENT_TIMESTAMP"
}
SocialMedia {
int id "Primary key, unique"
int user_id "References User.id, optional relationship"
varchar platform_name "Name of the social media platform, e.g., LinkedIn, GitHub, etc."
varchar profile_url "URL to the social media profile, verification required"
}
UserPreferences {
int id "Primary key, unique"
int user_id "References User.id, mandatory relationship"
bool dark_mode "Whether the user prefers dark mode, default is false"
varchar language "Preferred language of the user, default is 'English'"
enum event_preferences "Event preferences, e.g., hardware, software, etc."
enum privacy_mode "Privacy mode, to be defined"
bool is_subscribed "Whether the user is subscribed, default is 'No'"
enum diet_restrictions "Dietary restrictions, e.g., allergies, vegan, none, etc."
enum track_preferences "Track preferences, e.g., hardware, software, etc., optional"
enum interests "Interests of the user, e.g., languages, etc., optional"
enum shirt_size "Shirt size of the user"
enum disabilities "Disabilities, if any"
enum applicable_skills "Applicable skills of the user"
enum pronouns "Preferred pronouns of the user, e.g., he/him, she/her, they/them"
}
%% Relationships
User ||--o{ Resume : "References"
User ||--o{ School : "References"
User ||--o{ EmergencyContact : "References"
User ||--o{ Team : "References"
Team ||--|| User : "References"
Program ||--o{ School : "References"
SocialMedia ||--o{ User : "References"
UserPreferences ||--o{ User : "References"
%% Additional Notes
%% New table for application questions should reference User
%% Make rich text fields
%% Example of a potential Events table
%% Table Events {
%% int id "Primary key, unique"
%% varchar name "Name of the event"
%% }
%% Additional features to consider: team invites, grad year, job interest auto-fill, hackathon source, skills, agreements, personal website, Devpost link, travel accommodations, browser extension, user roles, dashboard, audit logs, CMS
Here is the code used for this diagram:
|
This was the original dbml that we had (used in dbdiagram.io):
|
I'll be looking more into more tools (that feature collaboration) and into the database design. |
@JeremyFriesenGitHub Can you a draft PR with this db design on the docs site and ask @sourcery-ai to review it? |
didn't see this lol, either way sourcery wouldn't have reviewed drafts |
Here is the editor link for the mermaid chart. |
@HasithDeAlwis High priority ⏫️⏫️ |
closing as stale, see #131 |
What feature should we improve? Please describe.
We need to make sure that all database design documents are visible to all contributors so they can see exactly how our database works on a higher level.
Describe the solution you'd like
Additional Context
See Figjam for Infrastructure Design for an idea on how our initial ideas were made.
The text was updated successfully, but these errors were encountered: