<?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 Version20190426102657 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 std_orders DROP FOREIGN KEY FK_866AAF66B9BE9DB9');
$this->addSql('DROP INDEX fk_std_orders_std_shipping_form ON std_orders');
$this->addSql('ALTER TABLE std_orders ADD shipping_form VARCHAR(20) DEFAULT NULL COMMENT \'Shipping Form\', ADD billing_address TINYINT(1) DEFAULT \'0\' NOT NULL COMMENT \'Flag that indicates if billing and shipping addresses are different\', DROP shipping_form_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 std_orders ADD shipping_form_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', DROP shipping_form, DROP billing_address');
$this->addSql('ALTER TABLE std_orders ADD CONSTRAINT FK_866AAF66B9BE9DB9 FOREIGN KEY (shipping_form_id) REFERENCES std_shipping_form (id)');
$this->addSql('CREATE INDEX fk_std_orders_std_shipping_form ON std_orders (shipping_form_id)');
}
}