<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20201104115608 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$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');
$this->addSql('ALTER TABLE event_price ADD CONSTRAINT FK_8BD393F5C980D5C1 FOREIGN KEY (ticket_type_id) REFERENCES ticket_type (id)');
$this->addSql('CREATE INDEX IDX_8BD393F5C980D5C1 ON event_price (ticket_type_id)');
$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');
$this->addSql('ALTER TABLE event_type_price ADD CONSTRAINT FK_9C2A7C01C980D5C1 FOREIGN KEY (ticket_type_id) REFERENCES ticket_type (id)');
$this->addSql('CREATE INDEX IDX_9C2A7C01C980D5C1 ON event_type_price (ticket_type_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE event_price DROP FOREIGN KEY FK_8BD393F5C980D5C1');
$this->addSql('DROP INDEX IDX_8BD393F5C980D5C1 ON event_price');
$this->addSql('ALTER TABLE event_price DROP ticket_type_id, DROP price, DROP sort');
$this->addSql('ALTER TABLE event_type_price DROP FOREIGN KEY FK_9C2A7C01C980D5C1');
$this->addSql('DROP INDEX IDX_9C2A7C01C980D5C1 ON event_type_price');
$this->addSql('ALTER TABLE event_type_price DROP ticket_type_id, DROP price, DROP sort');
}
}