From 07f07c28755754ffe49eefdf575d22e3af748337 Mon Sep 17 00:00:00 2001 From: Robbe Serry Date: Wed, 18 Oct 2023 09:58:25 +0000 Subject: [PATCH] bigger tiebreaker --- migrations/Version20231018095550.php | 35 +++++++++++++++++++ module/QuizBundle/Entity/Tiebreaker.php | 2 +- module/QuizBundle/Entity/TiebreakerAnswer.php | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 migrations/Version20231018095550.php diff --git a/migrations/Version20231018095550.php b/migrations/Version20231018095550.php new file mode 100644 index 0000000000..f627815ea6 --- /dev/null +++ b/migrations/Version20231018095550.php @@ -0,0 +1,35 @@ +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(); + } +} diff --git a/module/QuizBundle/Entity/Tiebreaker.php b/module/QuizBundle/Entity/Tiebreaker.php index 6a767e369e..74d4a94e15 100644 --- a/module/QuizBundle/Entity/Tiebreaker.php +++ b/module/QuizBundle/Entity/Tiebreaker.php @@ -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; diff --git a/module/QuizBundle/Entity/TiebreakerAnswer.php b/module/QuizBundle/Entity/TiebreakerAnswer.php index 2941f0cc84..86765b977f 100644 --- a/module/QuizBundle/Entity/TiebreakerAnswer.php +++ b/module/QuizBundle/Entity/TiebreakerAnswer.php @@ -45,7 +45,7 @@ class TiebreakerAnswer /** * @var integer The tiebreaker answer * - * @ORM\Column(type="smallint") + * @ORM\Column(type="integer") */ private $answer;