migrations/Version20220105215514.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 Version20220105215514 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('DROP TABLE IF EXISTS proctoru_timezones');
  19.         #$this->addSql('ALTER TABLE charges DROP description');
  20.         #$this->addSql('ALTER TABLE exams DROP study_materials_url');
  21.         #$this->addSql('ALTER TABLE registrations DROP proctorUrl');
  22.         $this->addSql('ALTER TABLE exams MODIFY COLUMN `language` tinyint(1) DEFAULT NULL AFTER talGroupCode');
  23.         $this->addSql('ALTER TABLE exams MODIFY COLUMN `content_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL AFTER language');
  24.         $this->addSql('ALTER TABLE exams MODIFY COLUMN `group_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL AFTER content_code');
  25.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN  `proctorUuid` varchar(250) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL AFTER onlineAccess');
  26.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `online_proctor_access` datetime DEFAULT NULL AFTER proctorUuid');
  27.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `online_exam_redirect` datetime DEFAULT NULL AFTER online_proctor_access');
  28.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `online_exam_started` datetime DEFAULT NULL AFTER online_exam_redirect');
  29.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `online_exam_completed` datetime DEFAULT NULL AFTER online_exam_started');
  30.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `session_scheduled` datetime DEFAULT NULL AFTER online_exam_completed');
  31.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `proctor_fee_price` decimal(6,2) DEFAULT NULL AFTER session_scheduled');
  32.         $this->addSql('ALTER TABLE registrations MODIFY COLUMN `proctor_reserved` datetime DEFAULT NULL AFTER proctor_fee_price');
  33.         $this->addSql('ALTER TABLE students MODIFY COLUMN  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL AFTER ttiStudentId');
  34.         $this->addSql('ALTER TABLE students MODIFY COLUMN `roles` json DEFAULT NULL AFTER password');
  35.         $this->addSql('ALTER TABLE students MODIFY COLUMN `tal_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL AFTER roles');
  36.         $this->addSql('ALTER TABLE students MODIFY COLUMN `tal_guid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL AFTER tal_id');
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->addSql('CREATE TABLE proctoru_timezones (id INT AUTO_INCREMENT NOT NULL, timezone_no INT NOT NULL, gmt_offset INT NOT NULL, proctoru_id VARCHAR(200) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, display_name VARCHAR(200) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, description VARCHAR(200) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, sort_order INT NOT NULL, dst SMALLINT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  42.         $this->addSql('DROP INDEX registrationId ON charges');
  43.         $this->addSql('ALTER TABLE charges ADD description VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`');
  44.         $this->addSql('ALTER TABLE exams ADD study_materials_url VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`');
  45.         $this->addSql('ALTER TABLE registrations ADD proctorUrl VARCHAR(250) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, ADD session_proctor_reserved DATETIME DEFAULT NULL');
  46.     }
  47. }