<?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 Version20230503095532 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add entity HistoryReflex';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE history_reflex (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, product_id INT DEFAULT NULL, supplier_order_id INT DEFAULT NULL, return_order_id INT DEFAULT NULL, filename VARCHAR(255) NOT NULL, type VARCHAR(30) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_6CA145D08D9F6D38 (order_id), INDEX IDX_6CA145D04584665A (product_id), INDEX IDX_6CA145D01605B9 (supplier_order_id), INDEX IDX_6CA145D09BE58A6F (return_order_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE history_reflex ADD CONSTRAINT FK_6CA145D08D9F6D38 FOREIGN KEY (order_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE history_reflex ADD CONSTRAINT FK_6CA145D04584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE history_reflex ADD CONSTRAINT FK_6CA145D01605B9 FOREIGN KEY (supplier_order_id) REFERENCES supplier_order (id)');
$this->addSql('ALTER TABLE history_reflex ADD CONSTRAINT FK_6CA145D09BE58A6F FOREIGN KEY (return_order_id) REFERENCES return_order (id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE history_reflex');
}
}