<?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 Version20230808153403 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 kc_server (id INT AUTO_INCREMENT NOT NULL, fqdn VARCHAR(127) NOT NULL, master_username VARCHAR(63) DEFAULT NULL, master_password VARCHAR(63) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE realm ADD kc_server_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE realm ADD CONSTRAINT FK_FA96DBDA5D71D18C FOREIGN KEY (kc_server_id) REFERENCES kc_server (id)');
$this->addSql('CREATE INDEX IDX_FA96DBDA5D71D18C ON realm (kc_server_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE realm DROP FOREIGN KEY FK_FA96DBDA5D71D18C');
$this->addSql('DROP TABLE kc_server');
$this->addSql('DROP INDEX IDX_FA96DBDA5D71D18C ON realm');
$this->addSql('ALTER TABLE realm DROP kc_server_id');
}
}