<?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 Version20240108204415 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 bewerking (id INT AUTO_INCREMENT NOT NULL, naam VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE onderdeel ADD bewerking_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE onderdeel ADD CONSTRAINT FK_A2B676ECCD929E5C FOREIGN KEY (bewerking_id) REFERENCES bewerking (id)');
$this->addSql('CREATE INDEX IDX_A2B676ECCD929E5C ON onderdeel (bewerking_id)');
$this->addSql('ALTER TABLE orderonderdeel ADD bewerking_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE orderonderdeel ADD CONSTRAINT FK_6D8ED13DCD929E5C FOREIGN KEY (bewerking_id) REFERENCES bewerking (id)');
$this->addSql('CREATE INDEX IDX_6D8ED13DCD929E5C ON orderonderdeel (bewerking_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE onderdeel DROP FOREIGN KEY FK_A2B676ECCD929E5C');
$this->addSql('ALTER TABLE orderonderdeel DROP FOREIGN KEY FK_6D8ED13DCD929E5C');
$this->addSql('DROP TABLE bewerking');
$this->addSql('DROP INDEX IDX_6D8ED13DCD929E5C ON orderonderdeel');
$this->addSql('ALTER TABLE orderonderdeel DROP bewerking_id');
$this->addSql('DROP INDEX IDX_A2B676ECCD929E5C ON onderdeel');
$this->addSql('ALTER TABLE onderdeel DROP bewerking_id');
}
}