<?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 Version20220104221338 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 cron_log ADD cron_task_id INT NOT NULL, DROP cron_name');
$this->addSql('ALTER TABLE cron_log ADD CONSTRAINT FK_7C0163B3AAC6A9FC FOREIGN KEY (cron_task_id) REFERENCES cron_task (id)');
$this->addSql('CREATE INDEX IDX_7C0163B3AAC6A9FC ON cron_log (cron_task_id)');
$this->addSql('ALTER TABLE cron_task CHANGE schedule schedule VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cron_log DROP FOREIGN KEY FK_7C0163B3AAC6A9FC');
$this->addSql('DROP INDEX IDX_7C0163B3AAC6A9FC ON cron_log');
$this->addSql('ALTER TABLE cron_log ADD cron_name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP cron_task_id');
$this->addSql('ALTER TABLE cron_task CHANGE schedule schedule VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
}