<?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 Version20220630010723 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->addSql('CREATE TABLE orders_sender (id INT AUTO_INCREMENT NOT NULL, orders_id INT DEFAULT NULL, sender_code VARCHAR(100) DEFAULT NULL, sender_name VARCHAR(100) DEFAULT NULL, sender_zip VARCHAR(100) DEFAULT NULL, sender_addr VARCHAR(100) DEFAULT NULL, sender_tel VARCHAR(100) DEFAULT NULL, sender_fax VARCHAR(100) DEFAULT NULL, create_date DATETIME NOT NULL, update_date DATETIME DEFAULT NULL, delete_date DATETIME DEFAULT NULL, INDEX IDX_FE90731ECFFE9AD6 (orders_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE orders_sender ADD CONSTRAINT FK_FE90731ECFFE9AD6 FOREIGN KEY (orders_id) REFERENCES orders (id)');
$this->addSql('ALTER TABLE destination ADD no VARCHAR(100) NOT NULL, DROP fax_no, CHANGE short_name kana VARCHAR(255) DEFAULT NULL, CHANGE address addr VARCHAR(255) NOT NULL, CHANGE tel_no tel VARCHAR(14) NOT NULL');
$this->addSql('ALTER TABLE orders CHANGE no no VARCHAR(100) DEFAULT NULL');
$this->addSql('ALTER TABLE partner ADD email VARCHAR(180) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE orders_sender');
$this->addSql('ALTER TABLE destination ADD fax_no VARCHAR(14) DEFAULT NULL, DROP no, CHANGE kana short_name VARCHAR(255) DEFAULT NULL, CHANGE addr address VARCHAR(255) NOT NULL, CHANGE tel tel_no VARCHAR(14) NOT NULL');
$this->addSql('ALTER TABLE orders CHANGE no no VARCHAR(100) NOT NULL');
$this->addSql('ALTER TABLE partner DROP email');
}
}