Adding initial game stats and visiting stats

This commit is contained in:
2025-07-07 20:07:02 +00:00
parent 1234d95510
commit 3f2568875f
4 changed files with 144 additions and 23 deletions

View File

@@ -24,23 +24,6 @@ CREATE TABLE IF NOT EXISTS teams (
PRIMARY KEY (team)
);
CREATE TABLE IF NOT EXISTS weather (
id INTEGER NOT NULL,
temperature SMALLINT,
wind_speed FLOAT,
air_pressure FLOAT,
humidity SMALLINT UNSIGNED,
uv_index FLOAT,
air_quality TINYINT UNSIGNED,
percipitation_type CHAR(10),
percipitation_amount FLOAT,
sky_condition CHAR(20),
sun_rise TIME,
sun_set TIME,
moon_phase TINYINT UNSIGNED,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS games (
id INTEGER NOT NULL,
game_date date NOT NULL,
@@ -67,7 +50,6 @@ CREATE TABLE IF NOT EXISTS games (
rf_ump_id CHAR(8),
rf_ump_name VARCHAR,
weather_id INT NOT NULL,
FOREIGN KEY (weather_id) REFERENCES weather(id)
FOREIGN KEY (park_id) REFERENCES parks(park_id)
PRIMARY KEY (id)
);
@@ -155,3 +137,20 @@ CREATE TABLE IF NOT EXISTS team_game (
PRIMARY KEY (game, team)
);
CREATE TABLE IF NOT EXISTS weather (
game_id INTEGER NOT NULL,
temperature SMALLINT,
wind_speed FLOAT,
air_pressure FLOAT,
humidity SMALLINT UNSIGNED,
uv_index FLOAT,
air_quality TINYINT UNSIGNED,
percipitation_type CHAR(10),
percipitation_amount FLOAT,
sky_condition CHAR(20),
sun_rise TIME,
sun_set TIME,
moon_phase TINYINT UNSIGNED,
FOREIGN KEY (game_id) REFERENCES games(id),
PRIMARY KEY (game_id)
);