From 8375d77d0fed2ffac1d2632961cb4aa7182671f6 Mon Sep 17 00:00:00 2001 From: Robbe Serry Date: Tue, 14 Nov 2023 15:35:48 +0000 Subject: [PATCH] fix ticket price size --- migrations/Version20231114153331.php | 39 +++++++++++++++++++++ module/TicketBundle/Entity/Event.php | 4 +-- module/TicketBundle/Entity/Event/Option.php | 4 +-- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 migrations/Version20231114153331.php diff --git a/migrations/Version20231114153331.php b/migrations/Version20231114153331.php new file mode 100644 index 0000000000..3f0d417d89 --- /dev/null +++ b/migrations/Version20231114153331.php @@ -0,0 +1,39 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE ticket_events ALTER price_members TYPE INT'); + $this->addSql('ALTER TABLE ticket_events ALTER price_members DROP DEFAULT'); + $this->addSql('ALTER TABLE ticket_events ALTER price_non_members TYPE INT'); + $this->addSql('ALTER TABLE ticket_events ALTER price_non_members DROP DEFAULT'); + $this->addSql('ALTER TABLE ticket_events_options ALTER price_members TYPE INT'); + $this->addSql('ALTER TABLE ticket_events_options ALTER price_members DROP DEFAULT'); + $this->addSql('ALTER TABLE ticket_events_options ALTER price_non_members TYPE INT'); + $this->addSql('ALTER TABLE ticket_events_options ALTER price_non_members DROP DEFAULT'); + } + + /** + * @param \Doctrine\DBAL\Schema\Schema $schema + * @return void + */ + public function down(Schema $schema) : void + { + $this->throwIrreversibleMigrationException(); + } +} diff --git a/module/TicketBundle/Entity/Event.php b/module/TicketBundle/Entity/Event.php index f0b56ae95a..f4fc023ba2 100644 --- a/module/TicketBundle/Entity/Event.php +++ b/module/TicketBundle/Entity/Event.php @@ -114,14 +114,14 @@ class Event /** * @var integer The price for members * - * @ORM\Column(name="price_members", type="smallint", nullable=true) + * @ORM\Column(name="price_members", type="integer", nullable=true) */ private $priceMembers; /** * @var integer The price for non members * - * @ORM\Column(name="price_non_members", type="smallint", nullable=true) + * @ORM\Column(name="price_non_members", type="integer", nullable=true) */ private $priceNonMembers; diff --git a/module/TicketBundle/Entity/Event/Option.php b/module/TicketBundle/Entity/Event/Option.php index 4a0d871c93..64a7b01d7a 100644 --- a/module/TicketBundle/Entity/Event/Option.php +++ b/module/TicketBundle/Entity/Event/Option.php @@ -38,14 +38,14 @@ class Option /** * @var integer The price for members * - * @ORM\Column(name="price_members", type="smallint") + * @ORM\Column(name="price_members", type="integer") */ private $priceMembers; /** * @var integer The price for non members * - * @ORM\Column(name="price_non_members", type="smallint", nullable=true) + * @ORM\Column(name="price_non_members", type="integer", nullable=true) */ private $priceNonMembers;