From d4f7a5c7de97e881050d906355266ddc341508c6 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sun, 3 Sep 2023 14:07:51 +0200 Subject: [PATCH] Add missing migration --- webapp/migrations/Version20230903101007.php | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 webapp/migrations/Version20230903101007.php diff --git a/webapp/migrations/Version20230903101007.php b/webapp/migrations/Version20230903101007.php new file mode 100644 index 00000000000..a4f6eb75f39 --- /dev/null +++ b/webapp/migrations/Version20230903101007.php @@ -0,0 +1,50 @@ +addSql('ALTER TABLE external_contest_source ADD last_httpcode SMALLINT UNSIGNED DEFAULT NULL COMMENT \'Last HTTP code received by event feed reader\''); + $this->addSql('ALTER TABLE language DROP compiler_command, DROP runner_command, DROP compiler_command_args, DROP runner_command_args'); + $this->addSql('ALTER TABLE queuetask DROP FOREIGN KEY FK_45E85FF85D5FEA72'); + $this->addSql('ALTER TABLE queuetask CHANGE judgingid judgingid INT UNSIGNED DEFAULT NULL COMMENT \'Judging ID\''); + $this->addSql('DROP INDEX jobid ON queuetask'); + $this->addSql('CREATE INDEX judgingid ON queuetask (judgingid)'); + $this->addSql('ALTER TABLE queuetask ADD CONSTRAINT FK_45E85FF85D5FEA72 FOREIGN KEY (judgingid) REFERENCES judging (judgingid) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE submission CHANGE import_error import_error VARCHAR(255) DEFAULT NULL COMMENT \'The error message for submissions which got an error during shadow importing.\''); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE language ADD compiler_command VARCHAR(255) DEFAULT NULL COMMENT \'Compiler command\', ADD runner_command VARCHAR(255) DEFAULT NULL COMMENT \'Runner command\', ADD compiler_command_args VARCHAR(255) DEFAULT NULL COMMENT \'Compiler command arguments\', ADD runner_command_args VARCHAR(255) DEFAULT NULL COMMENT \'Runner command arguments\''); + $this->addSql('ALTER TABLE queuetask DROP FOREIGN KEY FK_45E85FF85D5FEA72'); + $this->addSql('ALTER TABLE queuetask CHANGE judgingid judgingid INT UNSIGNED DEFAULT NULL COMMENT \'All queuetasks with the same jobid belong together.\''); + $this->addSql('DROP INDEX judgingid ON queuetask'); + $this->addSql('CREATE INDEX jobid ON queuetask (judgingid)'); + $this->addSql('ALTER TABLE queuetask ADD CONSTRAINT FK_45E85FF85D5FEA72 FOREIGN KEY (judgingid) REFERENCES judging (judgingid) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE external_contest_source DROP last_httpcode'); + $this->addSql('ALTER TABLE submission CHANGE import_error import_error VARCHAR(255) DEFAULT NULL COMMENT \'If this submission was imported during shadowing but had an error while doing so, the error message.\''); + } + + public function isTransactional(): bool + { + return false; + } +}