<?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 Version20220106100709 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('CREATE TABLE take_exception (id INT AUTO_INCREMENT NOT NULL, ward_id INT NOT NULL, take_id INT NOT NULL, created_by_id INT NOT NULL, deactivated_by_id INT DEFAULT NULL, created_at DATETIME NOT NULL, is_active TINYINT(1) NOT NULL, deactivated_at DATETIME DEFAULT NULL, INDEX IDX_5881F338D95D22FD (ward_id), INDEX IDX_5881F3383DF9AAF6 (take_id), INDEX IDX_5881F338B03A8386 (created_by_id), INDEX IDX_5881F338BDC76BAA (deactivated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE take_exception ADD CONSTRAINT FK_5881F338D95D22FD FOREIGN KEY (ward_id) REFERENCES ward (id)');
$this->addSql('ALTER TABLE take_exception ADD CONSTRAINT FK_5881F3383DF9AAF6 FOREIGN KEY (take_id) REFERENCES take (id)');
$this->addSql('ALTER TABLE take_exception ADD CONSTRAINT FK_5881F338B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE take_exception ADD CONSTRAINT FK_5881F338BDC76BAA FOREIGN KEY (deactivated_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE take_exception');
$this->addSql('ALTER TABLE student DROP FOREIGN KEY FK_B723AF333DF9AAF6');
$this->addSql('DROP INDEX IDX_B723AF333DF9AAF6 ON student');
$this->addSql('ALTER TABLE student_allocation DROP FOREIGN KEY FK_B19BCECB3DF9AAF6');
$this->addSql('DROP INDEX IDX_B19BCECB3DF9AAF6 ON student_allocation');
$this->addSql('ALTER TABLE student_allocation DROP take_id');
}
}