Skip to content

Commit d708684

Browse files
Sync database schema with entities
1 parent 47efe69 commit d708684

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

webapp/migrations/Version20250323190305.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class Version20250323190305 extends AbstractMigration
1414
{
1515
public function getDescription(): string
1616
{
17-
return '';
17+
return 'Add problem types';
1818
}
1919

2020
public function up(Schema $schema): void
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20250620082406 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return 'Change comments to reflect entities';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->addSql('ALTER TABLE judging CHANGE max_runtime_for_verdict max_runtime_for_verdict NUMERIC(32, 9) UNSIGNED DEFAULT NULL COMMENT \'The maximum runtime for all runs that resulted in the verdict\'');
24+
$this->addSql('ALTER TABLE problem CHANGE types types INT NOT NULL COMMENT \'Bitmask of problem types, default is pass-fail.\'');
25+
}
26+
27+
public function down(Schema $schema): void
28+
{
29+
// this down() migration is auto-generated, please modify it to your needs
30+
$this->addSql('ALTER TABLE problem CHANGE types types INT NOT NULL COMMENT \'Bitset of problem types, default is pass-fail.\'');
31+
$this->addSql('ALTER TABLE judging CHANGE max_runtime_for_verdict max_runtime_for_verdict NUMERIC(32, 9) UNSIGNED DEFAULT NULL COMMENT \'The maximum run time for all runs that resulted in the verdict\'');
32+
}
33+
34+
public function isTransactional(): bool
35+
{
36+
return false;
37+
}
38+
}

webapp/src/Entity/ExternalSourceWarning.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ExternalSourceWarning
4040
scale: 9,
4141
options: ['comment' => 'Time this warning happened last', 'unsigned' => true]
4242
)]
43-
private float $lastTime;
43+
private string|float $lastTime;
4444

4545
#[ORM\Column(options: ['comment' => 'Type of the entity for this warning'])]
4646
private string $entityType;
@@ -81,12 +81,12 @@ public function setLastEventId(?string $lastEventId): ExternalSourceWarning
8181
return $this;
8282
}
8383

84-
public function getLastTime(): float
84+
public function getLastTime(): string|float
8585
{
8686
return $this->lastTime;
8787
}
8888

89-
public function setLastTime(float $lastTime): ExternalSourceWarning
89+
public function setLastTime(string|float $lastTime): ExternalSourceWarning
9090
{
9191
$this->lastTime = $lastTime;
9292
return $this;

webapp/src/Entity/RankCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#[ORM\Index(columns: ['cid', 'points_public', 'totaltime_public', 'totalruntime_public'], name: 'order_public')]
2020
#[ORM\Index(columns: ['cid'], name: 'cid')]
2121
#[ORM\Index(columns: ['teamid'], name: 'teamid')]
22-
#[ORM\Index(columns: ['sort_key_public'], name: 'sortKeyPublic')]
23-
#[ORM\Index(columns: ['sort_key_restricted'], name: 'sortKeyRestricted')]
22+
#[ORM\Index(columns: ['sort_key_public'], name: 'sortKeyPublic', options: ['lengths' => [768]])]
23+
#[ORM\Index(columns: ['sort_key_restricted'], name: 'sortKeyRestricted', options: ['lengths' => [768]])]
2424
class RankCache
2525
{
2626
#[ORM\Column(options: [

0 commit comments

Comments
 (0)