<?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 Version20221018145923 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 operation (id INT AUTO_INCREMENT NOT NULL, box_id INT DEFAULT NULL, supplier_id INT DEFAULT NULL, provider_id INT DEFAULT NULL, slot_id INT DEFAULT NULL, executed_at DATETIME NOT NULL, source_state INT DEFAULT NULL, destination_state INT DEFAULT NULL, INDEX IDX_1981A66DD8177B3F (box_id), INDEX IDX_1981A66D2ADD6D8C (supplier_id), INDEX IDX_1981A66DA53A8AA (provider_id), INDEX IDX_1981A66D59E5119C (slot_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DD8177B3F FOREIGN KEY (box_id) REFERENCES box (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES supplier (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DA53A8AA FOREIGN KEY (provider_id) REFERENCES provider (id)');
$this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D59E5119C FOREIGN KEY (slot_id) REFERENCES slot (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE operation');
}
}