migrations/Version20221215091320.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 Version20221215091320 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 emotion_size ADD tray_id INT NOT NULL');
            $this->addSql('ALTER TABLE emotion_size ADD CONSTRAINT FK_31A481B6E8C42A45 FOREIGN KEY (tray_id) REFERENCES tray (id)');
            $this->addSql('CREATE INDEX IDX_31A481B6E8C42A45 ON emotion_size (tray_id)');
            $this->addSql('ALTER TABLE tray DROP size');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('ALTER TABLE emotion_size DROP FOREIGN KEY FK_31A481B6E8C42A45');
            $this->addSql('DROP INDEX IDX_31A481B6E8C42A45 ON emotion_size');
            $this->addSql('ALTER TABLE emotion_size DROP tray_id');
            $this->addSql('ALTER TABLE tray ADD size INT NOT NULL');
        }
    }