migrations/Version20221228104739.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 Version20221228104739 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 frame_technical_spec (frame_id INT NOT NULL, technical_spec_id INT NOT NULL, INDEX IDX_65F38CAB3FA3C347 (frame_id), INDEX IDX_65F38CABC6C3014A (technical_spec_id), PRIMARY KEY(frame_id, technical_spec_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('ALTER TABLE frame_technical_spec ADD CONSTRAINT FK_65F38CAB3FA3C347 FOREIGN KEY (frame_id) REFERENCES frame (id) ON DELETE CASCADE');
            $this->addSql('ALTER TABLE frame_technical_spec ADD CONSTRAINT FK_65F38CABC6C3014A FOREIGN KEY (technical_spec_id) REFERENCES technical_spec (id) ON DELETE CASCADE');
            $this->addSql('ALTER TABLE frame ADD texture_id INT DEFAULT NULL, ADD made_in_id INT DEFAULT NULL');
            $this->addSql('ALTER TABLE frame ADD CONSTRAINT FK_B5F83CCD204BC3AC FOREIGN KEY (texture_id) REFERENCES texture (id)');
            $this->addSql('ALTER TABLE frame ADD CONSTRAINT FK_B5F83CCD2AA78C5E FOREIGN KEY (made_in_id) REFERENCES made_in (id)');
            $this->addSql('CREATE INDEX IDX_B5F83CCD204BC3AC ON frame (texture_id)');
            $this->addSql('CREATE INDEX IDX_B5F83CCD2AA78C5E ON frame (made_in_id)');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('DROP TABLE frame_technical_spec');
            $this->addSql('ALTER TABLE frame DROP FOREIGN KEY FK_B5F83CCD204BC3AC');
            $this->addSql('ALTER TABLE frame DROP FOREIGN KEY FK_B5F83CCD2AA78C5E');
            $this->addSql('DROP INDEX IDX_B5F83CCD204BC3AC ON frame');
            $this->addSql('DROP INDEX IDX_B5F83CCD2AA78C5E ON frame');
            $this->addSql('ALTER TABLE frame DROP texture_id, DROP made_in_id');
        }
    }