<?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 Version20250722093712 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 channel_certificates_cursus_start (id INT NOT NULL, organization_id INT NOT NULL, body TEXT DEFAULT NULL, UNIQUE INDEX UNIQ_3F945E7832C8A3DE (organization_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE channel_certificates_cursus_start ADD CONSTRAINT FK_3F945E7832C8A3DE FOREIGN KEY (organization_id) REFERENCES channel_organizations (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE channel_certificates_cursus_start ADD CONSTRAINT FK_3F945E78BF396750 FOREIGN KEY (id) REFERENCES channel_certificates (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE channel_certificates DROP FOREIGN KEY FK_C15631FE32C8A3DE');
$this->addSql('DROP INDEX UNIQ_C15631FE32C8A3DE ON channel_certificates');
$this->addSql('ALTER TABLE channel_certificates ADD type VARCHAR(255) NOT NULL, DROP organization_id, DROP body');
$this->addSql('CREATE UNIQUE INDEX UNIQ_537D9B39A7A91E0B ON channel_white_label (domain)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE channel_certificates_cursus_start DROP FOREIGN KEY FK_3F945E7832C8A3DE');
$this->addSql('ALTER TABLE channel_certificates_cursus_start DROP FOREIGN KEY FK_3F945E78BF396750');
$this->addSql('DROP TABLE channel_certificates_cursus_start');
$this->addSql('ALTER TABLE channel_certificates ADD organization_id INT NOT NULL, ADD body TEXT DEFAULT NULL, DROP type');
$this->addSql('ALTER TABLE channel_certificates ADD CONSTRAINT FK_C15631FE32C8A3DE FOREIGN KEY (organization_id) REFERENCES channel_organizations (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C15631FE32C8A3DE ON channel_certificates (organization_id)');
$this->addSql('DROP INDEX UNIQ_537D9B39A7A91E0B ON channel_white_label');
}
}