<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240310182039 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tbl_lapin_production ADD etat_id INT DEFAULT NULL, DROP etat');
$this->addSql('ALTER TABLE tbl_lapin_production ADD CONSTRAINT FK_FA8825F2D5E86FF FOREIGN KEY (etat_id) REFERENCES ref_etat_lapin (id)');
$this->addSql('CREATE INDEX IDX_FA8825F2D5E86FF ON tbl_lapin_production (etat_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F71282B8B4');
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F7C8987118');
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F71282B8B4');
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file DROP FOREIGN KEY FK_FB1949F7C8987118');
$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');
$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');
$this->addSql('DROP INDEX idx_fb1949f71282b8b4 ON lnk_tbl_mouvement_tbl_file');
$this->addSql('CREATE INDEX IDX_A41CD54C1282B8B4 ON lnk_tbl_mouvement_tbl_file (tbl_mouvement_id)');
$this->addSql('DROP INDEX idx_fb1949f7c8987118 ON lnk_tbl_mouvement_tbl_file');
$this->addSql('CREATE INDEX IDX_A41CD54CC8987118 ON lnk_tbl_mouvement_tbl_file (tbl_file_id)');
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_FB1949F71282B8B4 FOREIGN KEY (tbl_mouvement_id) REFERENCES tbl_mouvement (id)');
$this->addSql('ALTER TABLE lnk_tbl_mouvement_tbl_file ADD CONSTRAINT FK_FB1949F7C8987118 FOREIGN KEY (tbl_file_id) REFERENCES tbl_file (id)');
$this->addSql('ALTER TABLE lnk_operationTravail_parcelle DROP FOREIGN KEY FK_96102F094433ED66');
$this->addSql('ALTER TABLE lnk_operationTravail_parcelle ADD CONSTRAINT FK_96102F094433ED66 FOREIGN KEY (parcelle_id) REFERENCES tbl_parcelle (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file DROP FOREIGN KEY FK_3A38EAF68997C6E');
$this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file DROP FOREIGN KEY FK_3A38EAF693CB796C');
$this->addSql('DROP INDEX idx_3a38eaf68997c6e ON lnk_tbl_mouvementCaisse_tbl_file');
$this->addSql('CREATE INDEX IDX_3A38EAF616268FC8 ON lnk_tbl_mouvementCaisse_tbl_file (mouvementCaisse_id)');
$this->addSql('DROP INDEX idx_3a38eaf693cb796c ON lnk_tbl_mouvementCaisse_tbl_file');
$this->addSql('CREATE INDEX IDX_3A38EAF6C8987118 ON lnk_tbl_mouvementCaisse_tbl_file (file_id)');
$this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file ADD CONSTRAINT FK_3A38EAF68997C6E FOREIGN KEY (mouvementCaisse_id) REFERENCES tbl_mouvement_caisse (id)');
$this->addSql('ALTER TABLE lnk_tbl_mouvementCaisse_tbl_file ADD CONSTRAINT FK_3A38EAF693CB796C FOREIGN KEY (file_id) REFERENCES tbl_file (id)');
$this->addSql('ALTER TABLE tbl_lapin_production DROP FOREIGN KEY FK_FA8825F2D5E86FF');
$this->addSql('DROP INDEX IDX_FA8825F2D5E86FF ON tbl_lapin_production');
$this->addSql('ALTER TABLE tbl_lapin_production ADD etat VARCHAR(255) DEFAULT NULL, DROP etat_id');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC47860E9B21');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC476C645A7F');
$this->addSql('DROP INDEX `PRIMARY` ON lnk_moyen_transport_tbl_operation_vente');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC47860E9B21');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC476C645A7F');
$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');
$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');
$this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente ADD PRIMARY KEY (ref_moyen_transport_id, tbl_operation_vente_id)');
$this->addSql('DROP INDEX idx_f5daec476c645a7f ON lnk_moyen_transport_tbl_operation_vente');
$this->addSql('CREATE INDEX IDX_6B7C3D426C645A7F ON lnk_moyen_transport_tbl_operation_vente (ref_moyen_transport_id)');
$this->addSql('DROP INDEX idx_f5daec47860e9b21 ON lnk_moyen_transport_tbl_operation_vente');
$this->addSql('CREATE INDEX IDX_6B7C3D42860E9B21 ON lnk_moyen_transport_tbl_operation_vente (tbl_operation_vente_id)');
$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)');
$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)');
$this->addSql('ALTER TABLE tbl_mouvement ADD parcelle_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE tbl_mouvement ADD CONSTRAINT FK_1ED993AD4433ED66 FOREIGN KEY (parcelle_id) REFERENCES tbl_parcelle (id)');
$this->addSql('CREATE INDEX IDX_1ED993AD4433ED66 ON tbl_mouvement (parcelle_id)');
}
}