migrations/Version20240330153539.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 Version20240330153539 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_production ADD created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL, ADD deleted_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL, ADD deleted_at DATETIME DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE tbl_production ADD CONSTRAINT FK_BAAEFB71DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
  20.         $this->addSql('ALTER TABLE tbl_production ADD CONSTRAINT FK_BAAEFB7116FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
  21.         $this->addSql('ALTER TABLE tbl_production ADD CONSTRAINT FK_BAAEFB711F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  22.         $this->addSql('CREATE INDEX IDX_BAAEFB71DE12AB56 ON tbl_production (created_by)');
  23.         $this->addSql('CREATE INDEX IDX_BAAEFB7116FE72E1 ON tbl_production (updated_by)');
  24.         $this->addSql('CREATE INDEX IDX_BAAEFB711F6FA0AF ON tbl_production (deleted_by)');
  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('DROP INDEX idx_f5daec47860e9b21 ON lnk_moyen_transport_tbl_operation_vente');
  30.         $this->addSql('CREATE INDEX IDX_6B7C3D42860E9B21 ON lnk_moyen_transport_tbl_operation_vente (tbl_operation_vente_id)');
  31.         $this->addSql('DROP INDEX idx_f5daec476c645a7f ON lnk_moyen_transport_tbl_operation_vente');
  32.         $this->addSql('CREATE INDEX IDX_6B7C3D426C645A7F ON lnk_moyen_transport_tbl_operation_vente (ref_moyen_transport_id)');
  33.         $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)');
  34.         $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)');
  35.         $this->addSql('ALTER TABLE tbl_mouvement ADD parcelle_id INT DEFAULT NULL');
  36.         $this->addSql('ALTER TABLE tbl_mouvement ADD CONSTRAINT FK_1ED993AD4433ED66 FOREIGN KEY (parcelle_id) REFERENCES tbl_parcelle (id)');
  37.         $this->addSql('CREATE INDEX IDX_1ED993AD4433ED66 ON tbl_mouvement (parcelle_id)');
  38.     }
  39. }