<?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 Version20221014125105 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 created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL');
$this->addSql('ALTER TABLE tbl_personnel ADD CONSTRAINT FK_E3349C4DDE12AB56 FOREIGN KEY (created_by) REFERENCES user (user_id)');
$this->addSql('ALTER TABLE tbl_personnel ADD CONSTRAINT FK_E3349C4D16FE72E1 FOREIGN KEY (updated_by) REFERENCES user (user_id)');
$this->addSql('CREATE INDEX IDX_E3349C4DDE12AB56 ON tbl_personnel (created_by)');
$this->addSql('CREATE INDEX IDX_E3349C4D16FE72E1 ON tbl_personnel (updated_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_E3349C4DDE12AB56');
$this->addSql('ALTER TABLE tbl_personnel DROP FOREIGN KEY FK_E3349C4D16FE72E1');
$this->addSql('DROP INDEX IDX_E3349C4DDE12AB56 ON tbl_personnel');
$this->addSql('DROP INDEX IDX_E3349C4D16FE72E1 ON tbl_personnel');
$this->addSql('ALTER TABLE tbl_personnel DROP created_by, DROP updated_by');
}
}