diff --git a/artifacts/Team Management Vision.pdf b/artifacts/Team Management Vision.pdf new file mode 100644 index 0000000..3317abd Binary files /dev/null and b/artifacts/Team Management Vision.pdf differ diff --git a/artifacts/Team_Manager_App_Database_Design.mwb b/artifacts/Team_Manager_App_Database_Design.mwb new file mode 100644 index 0000000..464868e Binary files /dev/null and b/artifacts/Team_Manager_App_Database_Design.mwb differ diff --git a/artifacts/entities.txt b/artifacts/entities.txt new file mode 100644 index 0000000..ef4b42f --- /dev/null +++ b/artifacts/entities.txt @@ -0,0 +1,149 @@ +# Place all entities in (as a list) this document +# Try to make the names descriptive +# One indent indicates attributes to that entity + + +# I came to the conclusion that the best way to represent an entity having multple references to an object (i.e. the many-to-many relationship: a team has multiple players) is to use joint-tables. +# To use this, we do not list the reference in the entity and instead make another table that will hold the entity id and the id of objects being reference +# See below for what I mean + +# The structure of where Orgs and Leagues is not yet determined but either way both need to be included + +Organization + organization_id : int + name : string + +(Joint-Table) Organizations-Leagues + organization_id : int + league_id : int +#Depending, we may use this joint table instead: +(Joint-Table) Organizations-Teams + organization_id : int + team_id : int + +League + league_id : int + name : string + +(Joint-Table) Leagues-Organizations + league_id : int + organization_id : int +#Depending, we may use this joint table instead: +(Joint-Table) Leagues-Teams + league_id : int + team_id : int + +Teams + team_id : int + name : string + color : string + mascot : string + wins : int + losses : int + ties : int + roster? #Not sure how to represent that + +(Joint-Table) Teams-Player + team_id : int + player_id :int + +(Joint-Table) Teams-Managers + team_id : int + manager_id : int + +(Joint-Table) Teams-Coaches + team_id : int + coach_id : int + +(Joint-Table) Teams-Parents + team_id : int + parent_id : int + +People + person_id : int + first_name : string + last_name : string + +(Joint Table) People-Addresses + person_id : int + address_id : int + +(Joint Table) People-Emails + person_id : int + email_id : int + +(Joint Table) People-Phones + person_id : int + phones_id : int + +Addresses + address_id : int + street1 : string + street2 : string + city : string + state : string + zip : int + +Phones + phone_id : int + number : string + +Emails + email_id : int + email : string + +Managers + manager_id : int + person_id : int + team_id : int + organization_id : int + league_id : int + +Coaches + coach_id : int + person_id : int + team_id : int + +Players + player_id : int + person_id : int + +Parents + parent_id : int + person_id : int + team_mom : boolean + +# The following will be how we can relate all the specific 'class' of peopleback to teams, orgs, and leagues for communication reasons + +(Joint Table) Players-Team + player_id : int + team_id : int + +(Joint Table) Players-Parents + player_id : int + parent_id : int + +# Not sure if we need this one... +(Joint Table) Parents-Players + parent_id : int + player_id : int + +(Joint Table) Parents-Teams + parent_id : int + team_id : int + +(Joint Table) Coaches-Teams + coach_id : int + team_id : int + +(Joint Table) Managers-Teams + manager_id : int + team_id : int + +(Joint Table) Managers-Organizations + manager_id : int + organizaion_id : int + +(Joint Table) Managers-Leagues + manager_id : int + league_id : int diff --git a/artifacts/issues.txt b/artifacts/issues.txt new file mode 100644 index 0000000..183ae57 --- /dev/null +++ b/artifacts/issues.txt @@ -0,0 +1,8 @@ +Current issues/missing abilities with the 'sports_org_erd_v3.mwb' + +1) Create a roster for a game. +2) Archive all team information for a given year. +3) Player and team accounting related to fees. +4) Web sessions? Not sure if this is related to database design. +5) Person-to-Person Message logging. + diff --git a/artifacts/sports_org_erd_v3.mwb b/artifacts/sports_org_erd_v3.mwb new file mode 100644 index 0000000..db3cded Binary files /dev/null and b/artifacts/sports_org_erd_v3.mwb differ diff --git a/generate_tables.sh b/generate_tables.sh new file mode 100755 index 0000000..5aa0108 --- /dev/null +++ b/generate_tables.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +## Scaffolds +# Person (People) table +rails g scaffold person id:int first_name:string last_name:string addr_route:string addr_city:string addr_state:string addr_zip:string username:string pass_hash:string pass_salt:string bio:text gender:string height_in_inches:string weight_in_pounds:string birth_month:int birth_day_number:int birth_year:int +# Phone_number (Phone_numbers) table +rails g scaffold phone_number phone:int person:references phone_id:string +# Email (Emails) table +rails g scaffold email email:string person:references +# Certification (Certifications) table +rails g scaffold certification person:references certification_name:string expiration_date:datetime note:text +# Role (Roles) table +rails g scaffold role id:int description:string value:int +# Team (Teams) tables +rails g scaffold team id:int team_name:string competitive:boolean age_group:string +# Organization (Organizations) table +rails g scaffold organization id:int name:string +# Event_property_map table +rails g scaffold event_property_map event_id:int key:string value:string +# Event (Events) table +rails g scaffold event id:int event_type:int event_datetime:datetime team_id:int created_by:int open_to_public:boolean +# Event_type table +rails g scaffold event_type id:int type_description:string + + +## Create Join Tables through migrations +# Parent_children (Join table) +# Team_people (Join table?) +# Team_person_roles (Join table) +# Organization_teams (Join table) + + +# Migrate the database +rails db:migrate