src/Migrations/Version20240903093344.php line 1
<?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 Version20240903093344 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE olymp_online_course_override ADD element_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE olymp_online_direction ADD moodle_course INT DEFAULT NULL, ADD moodle_element INT DEFAULT NULL');
$this->addSql('ALTER TABLE olymp_online_direction_langs ADD element_id INT DEFAULT NULL, CHANGE test_id course_id INT DEFAULT NULL');
$this->addSql('UPDATE olymp_online_direction SET moodle_course = moodle_courses->"$[0]" WHERE moodle_courses IS NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE olymp_online_course_override DROP element_id');
$this->addSql('ALTER TABLE olymp_online_direction DROP moodle_course, DROP moodle_element');
$this->addSql('ALTER TABLE olymp_online_direction_langs CHANGE course_id test_id INT DEFAULT NULL, DROP element_id');
}
}