migrations/Version20240330191521.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 Version20240330191521 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_details_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_details_production ADD CONSTRAINT FK_DC294916DE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
  20.         $this->addSql('ALTER TABLE tbl_details_production ADD CONSTRAINT FK_DC29491616FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
  21.         $this->addSql('ALTER TABLE tbl_details_production ADD CONSTRAINT FK_DC2949161F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  22.         $this->addSql('CREATE INDEX IDX_DC294916DE12AB56 ON tbl_details_production (created_by)');
  23.         $this->addSql('CREATE INDEX IDX_DC29491616FE72E1 ON tbl_details_production (updated_by)');
  24.         $this->addSql('CREATE INDEX IDX_DC2949161F6FA0AF ON tbl_details_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('ALTER TABLE tbl_details_production DROP FOREIGN KEY FK_DC294916DE12AB56');
  30.         $this->addSql('ALTER TABLE tbl_details_production DROP FOREIGN KEY FK_DC29491616FE72E1');
  31.         $this->addSql('ALTER TABLE tbl_details_production DROP FOREIGN KEY FK_DC2949161F6FA0AF');
  32.         $this->addSql('DROP INDEX IDX_DC294916DE12AB56 ON tbl_details_production');
  33.         $this->addSql('DROP INDEX IDX_DC29491616FE72E1 ON tbl_details_production');
  34.         $this->addSql('DROP INDEX IDX_DC2949161F6FA0AF ON tbl_details_production');
  35.         $this->addSql('ALTER TABLE tbl_details_production DROP created_by, DROP updated_by, DROP deleted_by, DROP created_at, DROP updated_at, DROP deleted_at');
  36.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC47860E9B21');
  37.         $this->addSql('ALTER TABLE lnk_moyen_transport_tbl_operation_vente DROP FOREIGN KEY FK_F5DAEC476C645A7F');
  38.     }
  39. }