fix(db/submissions): add key for #8
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-22 08:16:39 +08:00
parent a28e34e7e9
commit 37843355cd
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 4 additions and 1 deletions

View File

@ -775,7 +775,8 @@ CREATE TABLE `submissions` (
`is_hidden` tinyint(1) NOT NULL,
`status_details` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
KEY `is_hidden` (`is_hidden`,`problem_id`)
KEY `is_hidden` (`is_hidden`,`problem_id`),
KEY `score` (`problem_id`, `submitter`, `score`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -4,3 +4,4 @@ ALTER TABLE `assignments` DROP PRIMARY KEY, ADD PRIMARY KEY (`id`);
ALTER TABLE `assignments` ADD COLUMN `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE `assignments` CHANGE COLUMN `end_time` `deadline` datetime NOT NULL;
ALTER TABLE `countdowns` CHANGE COLUMN `end_time` `endtime` datetime NOT NULL;
ALTER TABLE `submissions` DROP KEY `score`;

View File

@ -4,3 +4,4 @@ ALTER TABLE `groups_assignments` ADD PRIMARY KEY (`group_id`, `list_id`);
ALTER TABLE `groups_assignments` DROP COLUMN `create_time`;
ALTER TABLE `groups_assignments` CHANGE COLUMN `deadline` `end_time` datetime NOT NULL;
ALTER TABLE `countdowns` CHANGE COLUMN `endtime` `end_time` datetime NOT NULL;
ALTER TABLE `submissions` ADD KEY `score` (`problem_id`, `submitter`, `score`);