Skip to content

Commit

Permalink
fix ticket price size
Browse files Browse the repository at this point in the history
  • Loading branch information
rserry committed Nov 14, 2023
1 parent b4b7e9f commit 8375d77
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 4 deletions.
39 changes: 39 additions & 0 deletions migrations/Version20231114153331.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);

namespace Migrations;

use Doctrine\DBAL\Schema\Schema;

/**
* Version 20231114153331
*/
class Version20231114153331 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 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();
}
}
4 changes: 2 additions & 2 deletions module/TicketBundle/Entity/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions module/TicketBundle/Entity/Event/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8375d77

Please sign in to comment.