migrations/Version20221218073250.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 Version20221218073250 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql("CREATE TABLE `seminary_testing_students` (
  19.                                                   `id` INT NOT NULL AUTO_INCREMENT,
  20.                                                   `firstName` VARCHAR(45) NULL,
  21.                                                   `lastName` VARCHAR(45) NULL,
  22.                                                   `email` VARCHAR(100) NULL,
  23.                                                   `ssn` VARCHAR(20) NULL,
  24.                                                   `dob` DATE NULL,
  25.                                                   `seminary_id` INT NULL,
  26.                                                   `tal_guid` VARCHAR(255) NULL,
  27.                                                   `created_date` DATE NULL,
  28.                                                   `created_by` VARCHAR(100) NULL,
  29.                                                   PRIMARY KEY (`id`));
  30.                                                 ");
  31.         $this->addSql("CREATE TABLE `seminary_testing_student_exams` (
  32.                                           `id` INT NOT NULL AUTO_INCREMENT,
  33.                                           `student_id` INT NULL,
  34.                                           `exam_id` INT NULL,
  35.                                           `exam_taken_date` DATETIME NULL,
  36.                                           `created_date` DATETIME NULL,
  37.                                           PRIMARY KEY (`id`));");
  38.         $this->addSql("ALTER TABLE `seminaries` 
  39.                             ADD COLUMN `for_seminary_testing` TINYINT NULL DEFAULT 0 AFTER `name`;");
  40.         $this->addSql("ALTER TABLE `exams` 
  41.                             ADD COLUMN `for_seminary_testing` TINYINT NULL DEFAULT 0 AFTER `assignments`;");
  42.     }
  43.     public function down(Schema $schema): void
  44.     {
  45.         // this down() migration is auto-generated, please modify it to your needs
  46.         $this->addSql("drop table seminary_testing_students");
  47.         $this->addSql("drop table seminary_testing_student_exams");
  48.         $this->addSql("ALTER TABLE `seminaries` drop COLUMN `for_seminary_testing`");
  49.         $this->addSql("ALTER TABLE `exams` drop COLUMN `for_seminary_testing`;");
  50.     }
  51. }