<?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 Version20240329093327 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 import_mapper_group (id INT AUTO_INCREMENT NOT NULL, realm_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_4FD05CA89DFF5F89 (realm_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE import_mapper_group ADD CONSTRAINT FK_4FD05CA89DFF5F89 FOREIGN KEY (realm_id) REFERENCES realm (id)');
$this->addSql('ALTER TABLE import_mapper ADD import_mapper_group_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE import_mapper ADD CONSTRAINT FK_44841EFC21F7092B FOREIGN KEY (import_mapper_group_id) REFERENCES import_mapper_group (id)');
$this->addSql('CREATE INDEX IDX_44841EFC21F7092B ON import_mapper (import_mapper_group_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE import_mapper DROP FOREIGN KEY FK_44841EFC21F7092B');
$this->addSql('ALTER TABLE import_mapper_group DROP FOREIGN KEY FK_4FD05CA89DFF5F89');
$this->addSql('DROP TABLE import_mapper_group');
$this->addSql('DROP INDEX IDX_44841EFC21F7092B ON import_mapper');
$this->addSql('ALTER TABLE import_mapper DROP import_mapper_group_id');
}
}