the-internet-vagabond-dot-com/src/projects/hmu/database.txt
2015-07-19 18:48:46 -04:00

58 lines
2.1 KiB
Text
Executable file

Database Layout
------------------------------------------------------------------------------------------------------
Table
Common Name -- Column Name -- Details
------------------------------------------------------------------------------------------------------
User
ID -- ID -- PRIMARY KEY Auto-Increment, Unique, Non-Null
First Name -- fname -- Non-Null
Username -- uname -- Unique, Non-Null
Password -- pword -- Non-Null
Email -- email -- Unique, Non-Null
Season
ID -- ID -- PRIMARY KEY, Auto-Increment, Unique, Non-Null
Number -- SeasonNo -- Unique, Non-Null
Hero
ID -- ID -- PRIMARY KEY Auto-Increment, Unique, Non-Null
User -- User.ID -- Foreign Key (User.ID)
Season -- Season.ID -- Foreign Key (Season.ID)
Team -- Team.ID -- Foreign Key (Team.ID)
Name -- HeroName -- Non-Null
Source -- HeroSource -- Non-Null
Points -- HeroPoints -- Non-Null
Tier -- HeroTier -- Non-Null
Color -- HeroColor -- Foreign Key (Team.TeamColor)
Team
ID -- ID -- PRIMARY KEY, Auto-Increment, Unique, Non-Null
User -- User.ID -- Foreign Key (User.ID)
Name -- TeamName -- Unique, Non-Null
Color -- TeamColor -- Unique, Non-Null
Synops -- TeamSynops -- --
Arena
ID -- ID -- PRIMARY KEY, Auto-Increment, Unique, Non-Null
Name -- ArenaName -- Unique, Non-Null
Points -- ArenaPoints -- Non-Null
Synops -- ArenaSynops -- Non-Null
Betting
ID -- ID -- PRIMARY KEY, Auto-Increment, Unique, Non-Null
User -- User.ID -- Foreign Key (User.ID)
Date -- BetDate -- Non-Null
Wager -- BetAmount -- Non-Null
First Team -- BetTeam1 -- Foreign Key (Team.ID)
Second Team -- BetTeam2 -- Foreign Key (Team.ID)
Arena -- Arena.ID -- Foreign Key (Arena.ID)
Result -- BetResult -- --
Database Permissions
- Users only have access to their teams
- Combatants do not have access to betting
- Narrators have access to all teams while they are the current narrator
- Admins have access to all teams at all times