migrations/Version20221215095449.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 Version20221215095449 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('DROP TABLE tray_emotion');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('CREATE TABLE tray_emotion (tray_id INT NOT NULL, emotion_id INT NOT NULL, INDEX IDX_89460F751EE4A582 (emotion_id), INDEX IDX_89460F75E8C42A45 (tray_id), PRIMARY KEY(tray_id, emotion_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
            $this->addSql('ALTER TABLE tray_emotion ADD CONSTRAINT FK_89460F751EE4A582 FOREIGN KEY (emotion_id) REFERENCES emotion (id) ON DELETE CASCADE');
            $this->addSql('ALTER TABLE tray_emotion ADD CONSTRAINT FK_89460F75E8C42A45 FOREIGN KEY (tray_id) REFERENCES tray (id) ON DELETE CASCADE');
        }
    }