<?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 Version20220916125234 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 job ADD completed INT DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE message_log ADD job_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE message_log ADD CONSTRAINT FK_A60AE229BE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
$this->addSql('CREATE INDEX IDX_A60AE229BE04EA9 ON message_log (job_id)');
$this->addSql('ALTER TABLE schedule ADD job_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE schedule ADD CONSTRAINT FK_5A3811FBBE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5A3811FBBE04EA9 ON schedule (job_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job DROP completed');
$this->addSql('ALTER TABLE message_log DROP FOREIGN KEY FK_A60AE229BE04EA9');
$this->addSql('DROP INDEX IDX_A60AE229BE04EA9 ON message_log');
$this->addSql('ALTER TABLE message_log DROP job_id');
$this->addSql('ALTER TABLE schedule DROP FOREIGN KEY FK_5A3811FBBE04EA9');
$this->addSql('DROP INDEX UNIQ_5A3811FBBE04EA9 ON schedule');
$this->addSql('ALTER TABLE schedule DROP job_id');
}
}