Add submissions table.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
Reference in New Issue
Block a user