migrations/Version20221001151458.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 Version20221001151458 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_personnel ADD deleted_by INT DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
  19.         $this->addSql('ALTER TABLE tbl_personnel ADD CONSTRAINT FK_E3349C4D1F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
  20.         $this->addSql('CREATE INDEX IDX_E3349C4D1F6FA0AF ON tbl_personnel (deleted_by)');
  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 tbl_personnel DROP FOREIGN KEY FK_E3349C4D1F6FA0AF');
  26.         $this->addSql('DROP INDEX IDX_E3349C4D1F6FA0AF ON tbl_personnel');
  27.         $this->addSql('ALTER TABLE tbl_personnel DROP deleted_by, DROP created_at, DROP updated_at, DROP deleted_at');
  28.     }
  29. }