<?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 Version20221116075807 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 external_supplier_history (id INT AUTO_INCREMENT NOT NULL, ym VARCHAR(6) NOT NULL, closing VARCHAR(2) NOT NULL, total INT DEFAULT NULL, filename VARCHAR(100) NOT NULL, export_date DATETIME DEFAULT NULL, create_date DATETIME NOT NULL, delete_date DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE sales_supply ADD external_supplier_history_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE sales_supply ADD CONSTRAINT FK_F0EDC6845912D70B FOREIGN KEY (external_supplier_history_id) REFERENCES external_supplier_history (id)');
$this->addSql('CREATE INDEX IDX_F0EDC6845912D70B ON sales_supply (external_supplier_history_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_supply DROP FOREIGN KEY FK_F0EDC6845912D70B');
$this->addSql('DROP TABLE external_supplier_history');
$this->addSql('DROP INDEX IDX_F0EDC6845912D70B ON sales_supply');
$this->addSql('ALTER TABLE sales_supply DROP external_supplier_history_id');
}
}