Skip to content

Add category types and allow teams to be in more than one category #3043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webapp/migrations/Version20250323190305.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class Version20250323190305 extends AbstractMigration
{
public function getDescription(): string
{
return '';
return 'Add problem types';
}

public function up(Schema $schema): void
Expand Down
38 changes: 38 additions & 0 deletions webapp/migrations/Version20250620082406.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250620082406 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change comments to reflect entities';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is unrelated to your PR but you wanted it in to cleanup the code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes so I can generate migrations

}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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\'');
$this->addSql('ALTER TABLE problem CHANGE types types INT NOT NULL COMMENT \'Bitmask of problem types, default is pass-fail.\'');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE problem CHANGE types types INT NOT NULL COMMENT \'Bitset of problem types, default is pass-fail.\'');
$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\'');
}

public function isTransactional(): bool
{
return false;
}
}
6 changes: 3 additions & 3 deletions webapp/src/Entity/ExternalSourceWarning.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ExternalSourceWarning
scale: 9,
options: ['comment' => 'Time this warning happened last', 'unsigned' => true]
)]
private float $lastTime;
private string|float $lastTime;

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

public function getLastTime(): float
public function getLastTime(): string|float
{
return $this->lastTime;
}

public function setLastTime(float $lastTime): ExternalSourceWarning
public function setLastTime(string|float $lastTime): ExternalSourceWarning
{
$this->lastTime = $lastTime;
return $this;
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/Entity/RankCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#[ORM\Index(columns: ['cid', 'points_public', 'totaltime_public', 'totalruntime_public'], name: 'order_public')]
#[ORM\Index(columns: ['cid'], name: 'cid')]
#[ORM\Index(columns: ['teamid'], name: 'teamid')]
#[ORM\Index(columns: ['sort_key_public'], name: 'sortKeyPublic')]
#[ORM\Index(columns: ['sort_key_restricted'], name: 'sortKeyRestricted')]
#[ORM\Index(columns: ['sort_key_public'], name: 'sortKeyPublic', options: ['lengths' => [768]])]
#[ORM\Index(columns: ['sort_key_restricted'], name: 'sortKeyRestricted', options: ['lengths' => [768]])]
class RankCache
{
#[ORM\Column(options: [
Expand Down