migrations/Version20220511160733.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 Version20220511160733 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 mecanique (id INT AUTO_INCREMENT NOT NULL, operation_id INT DEFAULT NULL, products_id INT DEFAULT NULL, reward VARCHAR(255) DEFAULT NULL, amount VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, INDEX IDX_F0573DA344AC3583 (operation_id), INDEX IDX_F0573DA36C8A81A9 (products_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE mecanique ADD CONSTRAINT FK_F0573DA344AC3583 FOREIGN KEY (operation_id) REFERENCES operation (id)');
  20.         $this->addSql('ALTER TABLE mecanique ADD CONSTRAINT FK_F0573DA36C8A81A9 FOREIGN KEY (products_id) REFERENCES product (id)');
  21.         $this->addSql('ALTER TABLE operation ADD shops_file VARCHAR(255) DEFAULT NULL, ADD url VARCHAR(255) DEFAULT NULL, ADD cible LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD justificatifs LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD product_mutliple TINYINT(1) DEFAULT NULL, ADD serial_number TINYINT(1) DEFAULT NULL, ADD text_serial_number VARCHAR(255) DEFAULT NULL, ADD legal_notice VARCHAR(255) DEFAULT NULL, DROP max_purchases, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME 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 mecanique');
  27.         $this->addSql('ALTER TABLE operation ADD max_purchases INT DEFAULT NULL, DROP shops_file, DROP url, DROP cible, DROP justificatifs, DROP product_mutliple, DROP serial_number, DROP text_serial_number, DROP legal_notice, CHANGE name name VARCHAR(255) NOT NULL, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
  28.     }
  29. }