<?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 Version20240317210433 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 modelonderdeel (id INT AUTO_INCREMENT NOT NULL, model_id INT NOT NULL, onderdeel_id INT NOT NULL, materiaal_id INT DEFAULT NULL, bewerking_id INT DEFAULT NULL, naam VARCHAR(255) NOT NULL, lengte INT DEFAULT NULL, breedte INT DEFAULT NULL, dikte INT DEFAULT NULL, aantal INT NOT NULL, INDEX IDX_46AC626F7975B7E7 (model_id), UNIQUE INDEX UNIQ_46AC626F9DDE249F (onderdeel_id), INDEX IDX_46AC626FCA754A38 (materiaal_id), INDEX IDX_46AC626FCD929E5C (bewerking_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE modelonderdeel ADD CONSTRAINT FK_46AC626F7975B7E7 FOREIGN KEY (model_id) REFERENCES model (id)');
$this->addSql('ALTER TABLE modelonderdeel ADD CONSTRAINT FK_46AC626F9DDE249F FOREIGN KEY (onderdeel_id) REFERENCES onderdeel (id)');
$this->addSql('ALTER TABLE modelonderdeel ADD CONSTRAINT FK_46AC626FCA754A38 FOREIGN KEY (materiaal_id) REFERENCES materiaal (id)');
$this->addSql('ALTER TABLE modelonderdeel ADD CONSTRAINT FK_46AC626FCD929E5C FOREIGN KEY (bewerking_id) REFERENCES bewerking (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE modelonderdeel DROP FOREIGN KEY FK_46AC626F7975B7E7');
$this->addSql('ALTER TABLE modelonderdeel DROP FOREIGN KEY FK_46AC626F9DDE249F');
$this->addSql('ALTER TABLE modelonderdeel DROP FOREIGN KEY FK_46AC626FCA754A38');
$this->addSql('ALTER TABLE modelonderdeel DROP FOREIGN KEY FK_46AC626FCD929E5C');
$this->addSql('DROP TABLE modelonderdeel');
}
}