You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
Just thinking about how to keep table naming consistent.
Tables
For the teams/league tools, we may have tables like:
player (full_name, gender, birth_date, ...)
team (name, ...)
team_roster (league_id, team_id, ...)
player_x_team_roster (player_id, team_roster_id, position ...)
league (start_date, end_date, days, ...)
So there would be players, who can play in many leagues and teams. Players and teams persist between leagues. For each league, a team will have a new team roster. The join table player_x_team_roster joins players to a team roster for that league. This naming table1_x_table2 would be used for all join tables.
How would fill-ins work? Maybe a team roster is not associated with a league, but each tie? Or perhaps a team roster stays associated with a league (for consistency, this might be called league_team_roster, but is only used for reference and maybe suggestions during player selection for a tie, but the teams for each tie could be completely arbitrary, eg.
tie (tie_t1_id, tie_t2_id, ...)
tie_team_roster (t1_player1_id, t1_player2_id, ...)
There might be a "lock teams" option for leagues which would prevent mixing and matching players like this, and would only allow players on the team roster.
Join tables
table1_x_table2 or xref_table1_table2 or xr_table1_table2
It's also worth mentioning for join tables, that you can do a compound primary key with the PRIMARY KEY table constraint like this:
I prefer the former, as start_date and birth_date sound better than starts_at and born_at, and starts_at implies the date is yet to come (likewise started_at). These should be UTC timestamps. If we need timezones, we can always add a timezone field to league.
Booleans
is_something
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Just thinking about how to keep table naming consistent.
Tables
For the teams/league tools, we may have tables like:
So there would be players, who can play in many leagues and teams. Players and teams persist between leagues. For each league, a team will have a new team roster. The join table
player_x_team_roster
joins players to a team roster for that league. This namingtable1_x_table2
would be used for all join tables.How would fill-ins work? Maybe a team roster is not associated with a league, but each tie? Or perhaps a team roster stays associated with a league (for consistency, this might be called
league_team_roster
, but is only used for reference and maybe suggestions during player selection for a tie, but the teams for each tie could be completely arbitrary, eg.There might be a "lock teams" option for leagues which would prevent mixing and matching players like this, and would only allow players on the team roster.
Join tables
table1_x_table2
orxref_table1_table2
orxr_table1_table2
It's also worth mentioning for join tables, that you can do a compound primary key with the
PRIMARY KEY
table constraint like this:Indexes
ix_table_fkey
Dates
something_date
orsomething_at
I prefer the former, as
start_date
andbirth_date
sound better thanstarts_at
andborn_at
, andstarts_at
implies the date is yet to come (likewisestarted_at
). These should be UTC timestamps. If we need timezones, we can always add atimezone
field toleague
.Booleans
is_something
The text was updated successfully, but these errors were encountered: