Skip to content

Commit 3de2cae

Browse files
committed
add column in rankCache table
1 parent b9585fc commit 3de2cae

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 Version20250519130014 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return '';
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 rankcache ADD totaloptscore_max_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Total max optscore (restricted audience)\', ADD optscore_max_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Max optscore (public audience)\', ADD optscore_min_restricted DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (restricted audience)\', ADD optscore_min_public DOUBLE PRECISION DEFAULT \'0\' NOT NULL COMMENT \'Min optscore (public audience)\'');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
// this down() migration is auto-generated, please modify it to your needs
29+
$this->addSql('ALTER TABLE rankcache DROP totaloptscore_max_restricted, DROP optscore_max_public, DROP optscore_min_restricted, DROP optscore_min_public');
30+
}
31+
32+
public function isTransactional(): bool
33+
{
34+
return false;
35+
}
36+
}

webapp/src/Entity/RankCache.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ class RankCache
5252
#[ORM\Column(options: ['comment' => 'Total runtime in milliseconds (public)', 'default' => 0])]
5353
private int $totalruntime_public = 0;
5454

55+
#[ORM\Column(options: ['comment' => 'Total max optscore (restricted audience)', 'default' => 0])]
56+
private float $totaloptscore_max_restricted = 0;
57+
58+
#[ORM\Column(options: ['comment' => 'Max optscore (public audience)', 'default' => 0])]
59+
private float $optscore_max_public = 0;
60+
61+
#[ORM\Column(options: ['comment' => 'Min optscore (restricted audience)', 'default' => 0])]
62+
private float $optscore_min_restricted = 0;
63+
64+
#[ORM\Column(options: ['comment' => 'Min optscore (public audience)', 'default' => 0])]
65+
private float $optscore_min_public = 0;
66+
5567
#[ORM\Id]
5668
#[ORM\ManyToOne]
5769
#[ORM\JoinColumn(name: 'cid', referencedColumnName: 'cid', onDelete: 'CASCADE')]
@@ -128,6 +140,50 @@ public function getTotalruntimePublic(): int
128140
return $this->totalruntime_public;
129141
}
130142

143+
public function setTotaloptscoreMaxRestricted(float $totaloptscoreMaxRestricted): RankCache
144+
{
145+
$this->totaloptscore_max_restricted = $totaloptscoreMaxRestricted;
146+
return $this;
147+
}
148+
149+
public function getTotaloptscoreMaxRestricted(): float
150+
{
151+
return $this->totaloptscore_max_restricted;
152+
}
153+
154+
public function setOptscoreMaxPublic(float $optscoreMaxPublic): RankCache
155+
{
156+
$this->optscore_max_public = $optscoreMaxPublic;
157+
return $this;
158+
}
159+
160+
public function getOptscoreMaxPublic(): float
161+
{
162+
return $this->optscore_max_public;
163+
}
164+
165+
public function setOptscoreMinRestricted(float $optscoreMinRestricted): RankCache
166+
{
167+
$this->optscore_min_restricted = $optscoreMinRestricted;
168+
return $this;
169+
}
170+
171+
public function getOptscoreMinRestricted(): float
172+
{
173+
return $this->optscore_min_restricted;
174+
}
175+
176+
public function setOptscoreMinPublic(float $optscoreMinPublic): RankCache
177+
{
178+
$this->optscore_min_public = $optscoreMinPublic;
179+
return $this;
180+
}
181+
182+
public function getOptscoreMinPublic(): float
183+
{
184+
return $this->optscore_min_public;
185+
}
186+
131187
public function setContest(?Contest $contest = null): RankCache
132188
{
133189
$this->contest = $contest;

0 commit comments

Comments
 (0)