From 4ce37ee3ead04c2eace50aa4a7df7cc2bcd2510b Mon Sep 17 00:00:00 2001 From: imcompiling Date: Mon, 17 Feb 2025 17:31:27 -0500 Subject: [PATCH] Add submissions table. --- database_setup/sql_data_classes.py | 5 +++-- highscores_database.sql | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/database_setup/sql_data_classes.py b/database_setup/sql_data_classes.py index 0cb27a1..25d42d5 100644 --- a/database_setup/sql_data_classes.py +++ b/database_setup/sql_data_classes.py @@ -11,7 +11,8 @@ Base = automap_base() Base.prepare(autoload_with=engine) # define the classes -Guild = Base.classes.Guilds -CategoryGroup = Base.classes.CategoryGroups Category = Base.classes.Categories +CategoryGroup = Base.classes.CategoryGroups +Guild = Base.classes.Guilds Score = Base.classes.Scores +Submission = Base.classes.Submissions diff --git a/highscores_database.sql b/highscores_database.sql index 4453b35..6e4be47 100644 --- a/highscores_database.sql +++ b/highscores_database.sql @@ -42,4 +42,13 @@ CREATE TABLE Scores( CategoryId int unsigned not null, FOREIGN KEY (CategoryId) REFERENCES Categories(CategoryId) ON DELETE CASCADE, PRIMARY KEY (CategoryId, UserName) +); + +CREATE TABLE Submissions( + CategoryId int unsigned not null, + GroupId int unsigned not null, + GuildId int unsigned not null, + MessageId int unsigned not null, + Score varchar(30) not null, -- Score is stored as a string until converted during submission + UserName varchar(30) not null ); \ No newline at end of file