Skip to content

Instantly share code, notes, and snippets.

@dlareau
Created August 19, 2020 02:43
Show Gist options
  • Save dlareau/26431f6337b44f7ce91cc4bf7d4328cb to your computer and use it in GitHub Desktop.
Save dlareau/26431f6337b44f7ce91cc4bf7d4328cb to your computer and use it in GitHub Desktop.
datablase player, team, and game draft
CREATE TABLE IF NOT EXISTS player(
player_id varchar(36) PRIMARY KEY, /* Use the uuid as the primary key */
captured_at timestamp /* The timestamp when this player data was fetched from the site. */
/* Or better yet if we can get it the timestamp the change took effect */
name text
deceased boolean
/* blaserunning */
base_thirst decimal
continuation decimal
ground_friction decimal
indulgence decimal
laserlikeness decimal
/* defense */
anticapitalism decimal
chasiness decimal
omniscience decimal
tenaciousness decimal
watchfulness decimal
/* hitting */
buoyancy decimal
divinity decimal
martyrdom decimal
moxie decimal
musclitude decimal
patheticism decimal
thwackability decimal
tragicness decimal
/* pitching */
coldness decimal
overpowerment decimal
ruthlessness decimal
shakespearianism decimal
suppression decimal
unthwackability decimal
total_fingers int
/* other */
pressurization decimal
cinnamon decimal
soul int
fate int
peanut_allergy boolean
bat text
);
CREATE TABLE IF NOT EXISTS team(
team_id varchar(36) PRIMARY KEY, /* Use the uuid as the primary key */
captured_at timestamp /* see the comment on player captured_at */
name text
nickname text
main_color text
secondary_color text
shorthand text
slogan text
emoji text
location text
championships int
division text
league text
/* maybe? */
season_attributes text[] /* Don't actually know what goes in here? Fourth strike? */
permanent_attributes text[] /* Same ^ */
shame_runs int
total_shames int
total_shamings int
);
CREATE TABLE IF NOT EXISTS game(
game_id varchar(36) PRIMARY KEY, /* Use the uuid as the primary key */
day int
season int
last_game_event int
home_odds decimal
away_odds decimal
weather int
/* Things that could be calculated instead but might be nice if blaseball format changes */
series_index int
series_length int
is_postseason int
/* Things that we technically could get from looking up the last game event */
/* (In the order that they should be here too) */
home_team varchar(36)
away_team varchar(36)
home_score int
away_score int
number_of_innings int
ended_on_top_of_inning boolean
ended_in_shame boolean
/* Things we don't know what they do yet but may be important later */
terminology_id varchar(36)
rules_id varchar(36)
statsheet_id varchar(36)
);
@dlareau
Copy link
Author

dlareau commented Aug 19, 2020

Note to self for v0.0.2: Team and player need new PK (not uuid) and add player armor, ritual, coffee and blood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment