<?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 Version20220106144948 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('CREATE TABLE job_logo (id INT AUTO_INCREMENT NOT NULL, image_name VARCHAR(255) NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job_ad ADD logo_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE job_ad ADD CONSTRAINT FK_C339C4A1F98F144A FOREIGN KEY (logo_id) REFERENCES job_logo (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C339C4A1F98F144A ON job_ad (logo_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_ad DROP FOREIGN KEY FK_C339C4A1F98F144A');
$this->addSql('DROP TABLE job_logo');
$this->addSql('DROP INDEX UNIQ_C339C4A1F98F144A ON job_ad');
$this->addSql('ALTER TABLE job_ad DROP logo_id');
}
}