Skip to content

Commit 8b8098b

Browse files
committed
Allow longer config options
1 parent f79a7e0 commit 8b8098b

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
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 Version20240224115108 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 configuration CHANGE name name VARCHAR(64) NOT NULL COMMENT \'Name of the configuration variable\'');
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 configuration CHANGE name name VARCHAR(32) NOT NULL COMMENT \'Name of the configuration variable\'');
30+
}
31+
32+
public function isTransactional(): bool
33+
{
34+
return false;
35+
}
36+
}

webapp/src/Entity/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Configuration
2020
#[ORM\Column(options: ['comment' => 'Configuration ID', 'unsigned' => true])]
2121
private int $configid;
2222

23-
#[ORM\Column(length: 32, options: ['comment' => 'Name of the configuration variable'])]
23+
#[ORM\Column(length: 64, options: ['comment' => 'Name of the configuration variable'])]
2424
private string $name;
2525

2626
#[ORM\Column(

webapp/tests/Unit/Controller/Jury/ConfigControllerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ function ($errors) {
5454
});
5555
}
5656

57+
/**
58+
* Test that we can change a longer config value.
59+
*/
60+
public function testChangedLongConfigName(): void
61+
{
62+
$this->withChangedConfiguration('config_external_contest_sources_allow_untrusted_certificates', 'on',
63+
function ($errors) {
64+
static::assertEmpty($errors);
65+
$this->verifyPageResponse('GET', '/jury/config', 200);
66+
});
67+
}
68+
5769
/**
5870
* Test that an invalid penalty time produces an error
5971
*/

0 commit comments

Comments
 (0)