migrations/Version20200926082709.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 Version20200926082709 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('ALTER TABLE dvf ADD id SERIAL NOT NULL');
  19.         $this->addSql('ALTER TABLE dvf ALTER numero_disposition TYPE VARCHAR(255)');
  20.         $this->addSql('ALTER TABLE dvf ALTER numero_disposition DROP DEFAULT');
  21.         $this->addSql('ALTER TABLE dvf ALTER adresse_numero TYPE VARCHAR(255)');
  22.         $this->addSql('ALTER TABLE dvf ALTER adresse_numero DROP DEFAULT');
  23.         $this->addSql('ALTER TABLE dvf ADD PRIMARY KEY (id)');
  24.         $this->addSql('ALTER TABLE pmc_dvfs ADD CONSTRAINT FK_9A3DE23D3784D7D FOREIGN KEY (dvf_id) REFERENCES dvf (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  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('CREATE SCHEMA public');
  30.         $this->addSql('DROP INDEX "primary"');
  31.         $this->addSql('ALTER TABLE dvf DROP id');
  32.         $this->addSql('ALTER TABLE dvf ALTER numero_disposition TYPE INT');
  33.         $this->addSql('ALTER TABLE dvf ALTER numero_disposition DROP DEFAULT');
  34.         $this->addSql('ALTER TABLE dvf ALTER adresse_numero TYPE INT');
  35.         $this->addSql('ALTER TABLE dvf ALTER adresse_numero DROP DEFAULT');
  36.         $this->addSql('ALTER TABLE pmc_dvfs DROP CONSTRAINT FK_9A3DE23D3784D7D');
  37.     }
  38. }