migrations/Version20221014165034.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 Version20221014165034 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 entete_devis ADD site_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE entete_devis ADD CONSTRAINT FK_6199F57CF6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');
  20.         $this->addSql('CREATE INDEX IDX_6199F57CF6BD1646 ON entete_devis (site_id)');
  21.         $this->addSql('ALTER TABLE entete_facture ADD site_id INT DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE entete_facture ADD CONSTRAINT FK_2DA57591F6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');
  23.         $this->addSql('CREATE INDEX IDX_2DA57591F6BD1646 ON entete_facture (site_id)');
  24.         $this->addSql('ALTER TABLE reglement_entreprise ADD site_id INT DEFAULT NULL');
  25.         $this->addSql('ALTER TABLE reglement_entreprise ADD CONSTRAINT FK_9C1D0D7FF6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');
  26.         $this->addSql('CREATE INDEX IDX_9C1D0D7FF6BD1646 ON reglement_entreprise (site_id)');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('ALTER TABLE entete_devis DROP FOREIGN KEY FK_6199F57CF6BD1646');
  32.         $this->addSql('DROP INDEX IDX_6199F57CF6BD1646 ON entete_devis');
  33.         $this->addSql('ALTER TABLE entete_devis DROP site_id');
  34.         $this->addSql('ALTER TABLE entete_facture DROP FOREIGN KEY FK_2DA57591F6BD1646');
  35.         $this->addSql('DROP INDEX IDX_2DA57591F6BD1646 ON entete_facture');
  36.         $this->addSql('ALTER TABLE entete_facture DROP site_id');
  37.         $this->addSql('ALTER TABLE reglement_entreprise DROP FOREIGN KEY FK_9C1D0D7FF6BD1646');
  38.         $this->addSql('DROP INDEX IDX_9C1D0D7FF6BD1646 ON reglement_entreprise');
  39.         $this->addSql('ALTER TABLE reglement_entreprise DROP site_id');
  40.     }
  41. }