<?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 Version20230628184529 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('ALTER TABLE wsc_collaborator DROP FOREIGN KEY FK_1CFB7649A7C41D6F');
$this->addSql('ALTER TABLE wsc_option DROP FOREIGN KEY FK_5E8C9692F8697D13');
$this->addSql('DROP TABLE wsc_option');
$this->addSql('DROP INDEX IDX_1CFB7649A7C41D6F ON wsc_collaborator');
$this->addSql('ALTER TABLE wsc_collaborator DROP option_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE wsc_option (id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', comment_id CHAR(36) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, sort_order INT DEFAULT NULL, created_at DATETIME NOT NULL, modified_at DATETIME NOT NULL, INDEX idx_name (name), INDEX IDX_5E8C9692F8697D13 (comment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE wsc_option ADD CONSTRAINT FK_5E8C9692F8697D13 FOREIGN KEY (comment_id) REFERENCES ws_comment (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE wsc_collaborator ADD option_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE wsc_collaborator ADD CONSTRAINT FK_1CFB7649A7C41D6F FOREIGN KEY (option_id) REFERENCES wsc_option (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_1CFB7649A7C41D6F ON wsc_collaborator (option_id)');
}
}