migrations/Version20220410200507.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220410200507 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE manufacturers_car_brands (manufacturers_id INT NOT NULL, car_brands_id INT NOT NULL, INDEX IDX_186DDAFCA2A4C2E4 (manufacturers_id), INDEX IDX_186DDAFCEE0C32EB (car_brands_id), PRIMARY KEY(manufacturers_id, car_brands_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE manufacturers_car_brands ADD CONSTRAINT FK_186DDAFCA2A4C2E4 FOREIGN KEY (manufacturers_id) REFERENCES manufacturers (id) ON DELETE CASCADE');
  20.         $this->addSql('ALTER TABLE manufacturers_car_brands ADD CONSTRAINT FK_186DDAFCEE0C32EB FOREIGN KEY (car_brands_id) REFERENCES car_brands (id) ON DELETE CASCADE');
  21.         $this->addSql('ALTER TABLE manufacturers ADD price_increase DOUBLE PRECISION DEFAULT NULL');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('DROP TABLE manufacturers_car_brands');
  27.         $this->addSql('ALTER TABLE manufacturers DROP price_increase');
  28.     }
  29. }