migrations/Version20201104115608.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20201104115608 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('ALTER TABLE event_price ADD ticket_type_id INT NOT NULL, ADD price NUMERIC(8, 2) NOT NULL, ADD sort INT DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE event_price ADD CONSTRAINT FK_8BD393F5C980D5C1 FOREIGN KEY (ticket_type_id) REFERENCES ticket_type (id)');
  21.         $this->addSql('CREATE INDEX IDX_8BD393F5C980D5C1 ON event_price (ticket_type_id)');
  22.         $this->addSql('ALTER TABLE event_type_price ADD ticket_type_id INT NOT NULL, ADD price NUMERIC(8, 2) NOT NULL, ADD sort INT DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE event_type_price ADD CONSTRAINT FK_9C2A7C01C980D5C1 FOREIGN KEY (ticket_type_id) REFERENCES ticket_type (id)');
  24.         $this->addSql('CREATE INDEX IDX_9C2A7C01C980D5C1 ON event_type_price (ticket_type_id)');
  25.     }
  26.     public function down(Schema $schema) : void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  30.         $this->addSql('ALTER TABLE event_price DROP FOREIGN KEY FK_8BD393F5C980D5C1');
  31.         $this->addSql('DROP INDEX IDX_8BD393F5C980D5C1 ON event_price');
  32.         $this->addSql('ALTER TABLE event_price DROP ticket_type_id, DROP price, DROP sort');
  33.         $this->addSql('ALTER TABLE event_type_price DROP FOREIGN KEY FK_9C2A7C01C980D5C1');
  34.         $this->addSql('DROP INDEX IDX_9C2A7C01C980D5C1 ON event_type_price');
  35.         $this->addSql('ALTER TABLE event_type_price DROP ticket_type_id, DROP price, DROP sort');
  36.     }
  37. }