<?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 Version20231207064100 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 community_post_comment (id INT AUTO_INCREMENT NOT NULL, user_id_id INT DEFAULT NULL, post_id_id INT DEFAULT NULL, parent_comment_id_id INT DEFAULT NULL, comment LONGTEXT DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_F68D5DC09D86650F (user_id_id), INDEX IDX_F68D5DC0E85F12B8 (post_id_id), INDEX IDX_F68D5DC0A586534 (parent_comment_id_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE community_post_comment ADD CONSTRAINT FK_F68D5DC09D86650F FOREIGN KEY (user_id_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE community_post_comment ADD CONSTRAINT FK_F68D5DC0E85F12B8 FOREIGN KEY (post_id_id) REFERENCES community_post (id)');
$this->addSql('ALTER TABLE community_post_comment ADD CONSTRAINT FK_F68D5DC0A586534 FOREIGN KEY (parent_comment_id_id) REFERENCES community_post_comment (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE community_post_comment DROP FOREIGN KEY FK_F68D5DC09D86650F');
$this->addSql('ALTER TABLE community_post_comment DROP FOREIGN KEY FK_F68D5DC0E85F12B8');
$this->addSql('ALTER TABLE community_post_comment DROP FOREIGN KEY FK_F68D5DC0A586534');
$this->addSql('DROP TABLE community_post_comment');
}
}