<?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 Version20190623213507 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 orders DROP FOREIGN KEY FK_E52FFDEE5F628B7A');
$this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEE7277D443');
$this->addSql('DROP INDEX IDX_E52FFDEE7277D443 ON orders');
$this->addSql('ALTER TABLE orders DROP isMobileForced, DROP idDriver');
}
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 orders ADD isMobileForced TINYINT(1) DEFAULT NULL, ADD idDriver INT DEFAULT NULL');
$this->addSql('ALTER TABLE orders ADD CONSTRAINT FK_E52FFDEE7277D443 FOREIGN KEY (idDriver) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_E52FFDEE7277D443 ON orders (idDriver)');
}
}