<?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 Version20200105063933 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 payment DROP FOREIGN KEY FK_B97A8036E2EDD085');
$this->addSql('DROP INDEX IDX_6D28840DE2EDD085 ON payment');
$this->addSql('ALTER TABLE payment DROP idOrder');
}
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 payment ADD idOrder INT DEFAULT NULL');
$this->addSql('ALTER TABLE payment ADD CONSTRAINT FK_B97A8036E2EDD085 FOREIGN KEY (idOrder) REFERENCES orders (id)');
$this->addSql('CREATE INDEX IDX_6D28840DE2EDD085 ON payment (idOrder)');
}
}