<?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 Version20220419101548 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 box (id INT AUTO_INCREMENT NOT NULL, delivery_id INT NOT NULL, slot_id INT DEFAULT NULL, ident VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, weight INT NOT NULL, INDEX IDX_8A9483A12136921 (delivery_id), UNIQUE INDEX UNIQ_8A9483A59E5119C (slot_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE delivery (id INT AUTO_INCREMENT NOT NULL, customer_id INT DEFAULT NULL, container_id INT DEFAULT NULL, ident VARCHAR(255) NOT NULL, state INT NOT NULL, INDEX IDX_3781EC109395C3F3 (customer_id), INDEX IDX_3781EC10BC21F742 (container_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE box ADD CONSTRAINT FK_8A9483A12136921 FOREIGN KEY (delivery_id) REFERENCES delivery (id)');
$this->addSql('ALTER TABLE box ADD CONSTRAINT FK_8A9483A59E5119C FOREIGN KEY (slot_id) REFERENCES slot (id)');
$this->addSql('ALTER TABLE delivery ADD CONSTRAINT FK_3781EC109395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE delivery ADD CONSTRAINT FK_3781EC10BC21F742 FOREIGN KEY (container_id) REFERENCES container (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE box DROP FOREIGN KEY FK_8A9483A12136921');
$this->addSql('DROP TABLE box');
$this->addSql('DROP TABLE delivery');
}
}