<?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 Version20221001151458 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_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)\'');
$this->addSql('ALTER TABLE tbl_personnel ADD CONSTRAINT FK_E3349C4D1F6FA0AF FOREIGN KEY (deleted_by) REFERENCES user (user_id)');
$this->addSql('CREATE INDEX IDX_E3349C4D1F6FA0AF ON tbl_personnel (deleted_by)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tbl_personnel DROP FOREIGN KEY FK_E3349C4D1F6FA0AF');
$this->addSql('DROP INDEX IDX_E3349C4D1F6FA0AF ON tbl_personnel');
$this->addSql('ALTER TABLE tbl_personnel DROP deleted_by, DROP created_at, DROP updated_at, DROP deleted_at');
}
}