migrations/Version20220506004839.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 Version20220506004839 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 invoice_type (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE invoice_type ADD CONSTRAINT FK_8E1B354CBF396750 FOREIGN KEY (id) REFERENCES choice_element (id) ON DELETE CASCADE');
  20.         $this->addSql('ALTER TABLE invoice_deposit ADD type_id INT DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE invoice_deposit ADD CONSTRAINT FK_6702ABEAC54C8C93 FOREIGN KEY (type_id) REFERENCES invoice_type (id)');
  22.         $this->addSql('CREATE INDEX IDX_6702ABEAC54C8C93 ON invoice_deposit (type_id)');
  23.         $this->addSql('ALTER TABLE provider ADD current_document LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
  24.         $this->addSql('ALTER TABLE recruitment_campaign DROP nb_request');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE invoice_deposit DROP FOREIGN KEY FK_6702ABEAC54C8C93');
  30.         $this->addSql('DROP TABLE invoice_type');
  31.         $this->addSql('DROP INDEX IDX_6702ABEAC54C8C93 ON invoice_deposit');
  32.         $this->addSql('ALTER TABLE invoice_deposit DROP type_id');
  33.         $this->addSql('ALTER TABLE provider DROP current_document');
  34.         $this->addSql('ALTER TABLE recruitment_campaign ADD nb_request INT NOT NULL');
  35.     }
  36. }