Add submissions table.

This commit is contained in:
2025-02-17 17:40:03 -05:00
parent c62b87c7f7
commit 4ce37ee3ea
2 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -11,7 +11,8 @@ Base = automap_base()
Base.prepare(autoload_with=engine) Base.prepare(autoload_with=engine)
# define the classes # define the classes
Guild = Base.classes.Guilds
CategoryGroup = Base.classes.CategoryGroups
Category = Base.classes.Categories Category = Base.classes.Categories
CategoryGroup = Base.classes.CategoryGroups
Guild = Base.classes.Guilds
Score = Base.classes.Scores Score = Base.classes.Scores
Submission = Base.classes.Submissions
+9
View File
@@ -42,4 +42,13 @@ CREATE TABLE Scores(
CategoryId int unsigned not null, CategoryId int unsigned not null,
FOREIGN KEY (CategoryId) REFERENCES Categories(CategoryId) ON DELETE CASCADE, FOREIGN KEY (CategoryId) REFERENCES Categories(CategoryId) ON DELETE CASCADE,
PRIMARY KEY (CategoryId, UserName) 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
); );