<?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 Version20221130220611 extends AbstractMigration
{
public function getDescription(): string
{
return 'Added semester_clearances_history';
}
public function up(Schema $schema): void
{
$this->addSql(
<<<'SQL'
CREATE TABLE semester_clearances_history (id INT AUTO_INCREMENT NOT NULL, profile_id INT DEFAULT NULL, semester INT NOT NULL, type ENUM('VALID', 'INVALIDATED', 'FROZEN', 'DELETED') NOT NULL COMMENT '(DC2Type:semester_clearance_type)', message VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)', updated_by VARCHAR(255) DEFAULT NULL, INDEX IDX_5CC14DC9CCFA12B8 (profile_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
SQL
);
$this->addSql(
<<<'SQL'
ALTER TABLE semester_clearances_history ADD CONSTRAINT FK_5CC14DC9CCFA12B8 FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE
SQL
);
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE semester_clearances_history');
}
}