<?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 Version20220802145856 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 channel_channels DROP FOREIGN KEY FK_84A4911F3DA5256D');
$this->addSql('DROP TABLE channel_images');
$this->addSql('DROP INDEX IDX_84A4911F3DA5256D ON channel_channels');
$this->addSql('ALTER TABLE channel_channels DROP image_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE channel_images (id INT AUTO_INCREMENT NOT NULL, owner_channel_id VARCHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name VARCHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, extension VARCHAR(6) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, title VARCHAR(63) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, description VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_1E7C8414209F38EF (owner_channel_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE channel_images ADD CONSTRAINT FK_1E7C8414209F38EF FOREIGN KEY (owner_channel_id) REFERENCES channel_channels (id)');
$this->addSql('ALTER TABLE channel_channels ADD image_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE channel_channels ADD CONSTRAINT FK_84A4911F3DA5256D FOREIGN KEY (image_id) REFERENCES channel_images (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_84A4911F3DA5256D ON channel_channels (image_id)');
}
}