migrations/Version20240116052029.php line 1

Open in your IDE?
  1. <?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 Version20240116052029 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_hide (id INT AUTO_INCREMENT NOT NULL, post_id INT DEFAULT NULL, community_group_id INT DEFAULT NULL, user_id INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_C8345F8E4B89032C (post_id), INDEX IDX_C8345F8EC121C60 (community_group_id), INDEX IDX_C8345F8EA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('CREATE TABLE community_post_share (id INT AUTO_INCREMENT NOT NULL, post_id INT DEFAULT NULL, community_group_id INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_49D667A94B89032C (post_id), INDEX IDX_49D667A9C121C60 (community_group_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('ALTER TABLE community_post_hide ADD CONSTRAINT FK_C8345F8E4B89032C FOREIGN KEY (post_id) REFERENCES community_post (id)');
            $this->addSql('ALTER TABLE community_post_hide ADD CONSTRAINT FK_C8345F8EC121C60 FOREIGN KEY (community_group_id) REFERENCES community_groups (id)');
            $this->addSql('ALTER TABLE community_post_hide ADD CONSTRAINT FK_C8345F8EA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
            $this->addSql('ALTER TABLE community_post_share ADD CONSTRAINT FK_49D667A94B89032C FOREIGN KEY (post_id) REFERENCES community_post (id)');
            $this->addSql('ALTER TABLE community_post_share ADD CONSTRAINT FK_49D667A9C121C60 FOREIGN KEY (community_group_id) REFERENCES community_groups (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_hide DROP FOREIGN KEY FK_C8345F8E4B89032C');
            $this->addSql('ALTER TABLE community_post_hide DROP FOREIGN KEY FK_C8345F8EC121C60');
            $this->addSql('ALTER TABLE community_post_hide DROP FOREIGN KEY FK_C8345F8EA76ED395');
            $this->addSql('ALTER TABLE community_post_share DROP FOREIGN KEY FK_49D667A94B89032C');
            $this->addSql('ALTER TABLE community_post_share DROP FOREIGN KEY FK_49D667A9C121C60');
            $this->addSql('DROP TABLE community_post_hide');
            $this->addSql('DROP TABLE community_post_share');
            
        }
    }