migrations/Version20240310182039.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 Version20240310182039 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 tbl_lapin_production ADD etat_id INT DEFAULT NULL, DROP etat');
  19.         $this->addSql('ALTER TABLE tbl_lapin_production ADD CONSTRAINT FK_FA8825F2D5E86FF FOREIGN KEY (etat_id) REFERENCES ref_etat_lapin (id)');
  20.         $this->addSql('CREATE INDEX IDX_FA8825F2D5E86FF ON tbl_lapin_production (etat_id)');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F71282B8B4');
  26.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F7C8987118');
  27.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F71282B8B4');
  28.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F7C8987118');
  29.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_A41CD54CC8987118 FOREIGN KEY (tbl_file_id) REFERENCES tbl_file (id) ON DELETE CASCADE');
  30.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_A41CD54C1282B8B4 FOREIGN KEY (tbl_mouvement_id) REFERENCES tbl_mouvement (id) ON DELETE CASCADE');
  31.         $this->addSql('DROP INDEX idx_fb1949f71282b8b4 ON lnk_tbl_mouvement_tbl_file');
  32.         $this->addSql('CREATE INDEX IDX_A41CD54C1282B8B4 ON lnk_tbl_mouvement_tbl_file (tbl_mouvement_id)');
  33.         $this->addSql('DROP INDEX idx_fb1949f7c8987118 ON lnk_tbl_mouvement_tbl_file');
  34.         $this->addSql('CREATE INDEX IDX_A41CD54CC8987118 ON lnk_tbl_mouvement_tbl_file (tbl_file_id)');
  35.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_FB1949F71282B8B4 FOREIGN KEY (tbl_mouvement_id) REFERENCES tbl_mouvement (id)');
  36.         $this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_FB1949F7C8987118 FOREIGN KEY (tbl_file_id) REFERENCES tbl_file (id)');
  37.         $this->addSql('ALTER TABLE lnk_operationTravail_parcelle DROP FOREIGN KEY FK_96102F094433ED66');
  38.         $this->addSql('ALTER TABLE lnk_operationTravail_parcelle ADD CONSTRAINT FK_96102F094433ED66 FOREIGN KEY (parcelle_id) REFERENCES tbl_parcelle (id) ON DELETE CASCADE');
  39.         $this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file DROP FOREIGN KEY FK_3A38EAF68997C6E');
  40.         $this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file DROP FOREIGN KEY FK_3A38EAF693CB796C');
  41.         $this->addSql('DROP INDEX idx_3a38eaf68997c6e ON lnk_tbl_mouvementCaisse_tbl_file');
  42.         $this->addSql('CREATE INDEX IDX_3A38EAF616268FC8 ON lnk_tbl_mouvementCaisse_tbl_file (mouvementCaisse_id)');
  43.         $this->addSql('DROP INDEX idx_3a38eaf693cb796c ON lnk_tbl_mouvementCaisse_tbl_file');
  44.         $this->addSql('CREATE INDEX IDX_3A38EAF6C8987118 ON lnk_tbl_mouvementCaisse_tbl_file (file_id)');
  45.         $this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file ADD CONSTRAINT FK_3A38EAF68997C6E FOREIGN KEY (mouvementCaisse_id) REFERENCES tbl_mouvement_caisse (id)');
  46.         $this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file ADD CONSTRAINT FK_3A38EAF693CB796C FOREIGN KEY (file_id) REFERENCES tbl_file (id)');
  47.         $this->addSql('ALTER TABLE tbl_lapin_production DROP FOREIGN KEY FK_FA8825F2D5E86FF');
  48.         $this->addSql('DROP INDEX IDX_FA8825F2D5E86FF ON tbl_lapin_production');
  49.         $this->addSql('ALTER TABLE tbl_lapin_production ADD etat VARCHAR(255) DEFAULT NULL, DROP etat_id');
  50.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC47860E9B21');
  51.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC476C645A7F');
  52.         $this->addSql('DROP INDEX `PRIMARY` ON lnk_moyen_transport_tbl_operation_vente');
  53.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC47860E9B21');
  54.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC476C645A7F');
  55.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_6B7C3D42860E9B21 FOREIGN KEY (tbl_operation_vente_id) REFERENCES tbl_operation_vente (id) ON DELETE CASCADE');
  56.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_6B7C3D426C645A7F FOREIGN KEY (ref_moyen_transport_id) REFERENCES ref_moyen_transport (id) ON DELETE CASCADE');
  57.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD PRIMARY KEY (ref_moyen_transport_id, tbl_operation_vente_id)');
  58.         $this->addSql('DROP INDEX idx_f5daec476c645a7f ON lnk_moyen_transport_tbl_operation_vente');
  59.         $this->addSql('CREATE INDEX IDX_6B7C3D426C645A7F ON lnk_moyen_transport_tbl_operation_vente (ref_moyen_transport_id)');
  60.         $this->addSql('DROP INDEX idx_f5daec47860e9b21 ON lnk_moyen_transport_tbl_operation_vente');
  61.         $this->addSql('CREATE INDEX IDX_6B7C3D42860E9B21 ON lnk_moyen_transport_tbl_operation_vente (tbl_operation_vente_id)');
  62.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_F5DAEC47860E9B21 FOREIGN KEY (tbl_operation_vente_id) REFERENCES tbl_operation_vente (id)');
  63.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD CONSTRAINT FK_F5DAEC476C645A7F FOREIGN KEY (ref_moyen_transport_id) REFERENCES ref_moyen_transport (id)');
  64.         $this->addSql('ALTER TABLE tbl_mouvement ADD parcelle_id INT DEFAULT NULL');
  65.         $this->addSql('ALTER TABLE tbl_mouvement ADD CONSTRAINT FK_1ED993AD4433ED66 FOREIGN KEY (parcelle_id) REFERENCES tbl_parcelle (id)');
  66.         $this->addSql('CREATE INDEX IDX_1ED993AD4433ED66 ON tbl_mouvement (parcelle_id)');
  67.     }
  68. }