migrations/Version20221130220611.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 Version20221130220611 extends AbstractMigration
  10.     {
  11.         public function getDescription(): string
  12.         {
  13.             return 'Added semester_clearances_history';
  14.         }
  15.         public function up(Schema $schema): void
  16.         {
  17.             $this->addSql(
  18.                 <<<'SQL'
  19. 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
  20. SQL
  21.             );
  22.             $this->addSql(
  23.                 <<<'SQL'
  24. ALTER TABLE semester_clearances_history ADD CONSTRAINT FK_5CC14DC9CCFA12B8 FOREIGN KEY (profile_id) REFERENCES profiles (id) ON DELETE CASCADE
  25. SQL
  26.             );
  27.         }
  28.         public function down(Schema $schema): void
  29.         {
  30.             $this->addSql('DROP TABLE semester_clearances_history');
  31.         }
  32.     }