Skip to content

Commit

Permalink
bigger tiebreaker
Browse files Browse the repository at this point in the history
  • Loading branch information
rserry committed Oct 18, 2023
1 parent 1e5e013 commit 07f07c2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions migrations/Version20231018095550.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);

namespace Migrations;

use Doctrine\DBAL\Schema\Schema;

/**
* Version 20231018095550
*/
class Version20231018095550 extends \Doctrine\Migrations\AbstractMigration
{
/**
* @param \Doctrine\DBAL\Schema\Schema $schema
* @return void
*/
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('ALTER TABLE quiz_tiebreaker_answers ALTER answer TYPE INT');
$this->addSql('ALTER TABLE quiz_tiebreaker_answers ALTER answer DROP DEFAULT');
$this->addSql('ALTER TABLE quiz_tiebreakers ALTER correct_answer TYPE INT');
$this->addSql('ALTER TABLE quiz_tiebreakers ALTER correct_answer DROP DEFAULT');
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
* @return void
*/
public function down(Schema $schema) : void
{
$this->throwIrreversibleMigrationException();
}
}
2 changes: 1 addition & 1 deletion module/QuizBundle/Entity/Tiebreaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Tiebreaker
/**
* @var integer The correct answer to this tiebreaker
*
* @ORM\Column(name="correct_answer", type="smallint")
* @ORM\Column(name="correct_answer", type="integer")
*/
private $correctAnswer;

Expand Down
2 changes: 1 addition & 1 deletion module/QuizBundle/Entity/TiebreakerAnswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class TiebreakerAnswer
/**
* @var integer The tiebreaker answer
*
* @ORM\Column(type="smallint")
* @ORM\Column(type="integer")
*/
private $answer;

Expand Down

0 comments on commit 07f07c2

Please sign in to comment.