<?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 Version20240312123501 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_scholastic_duration (id INT AUTO_INCREMENT NOT NULL, duration_name VARCHAR(191) NOT NULL, position SMALLINT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job ADD job_scholastic_duration_id INT DEFAULT NULL, DROP scholastic_duration');
$this->addSql('ALTER TABLE job ADD CONSTRAINT FK_FBD8E0F898680F6C FOREIGN KEY (job_scholastic_duration_id) REFERENCES job_scholastic_duration (id)');
$this->addSql('CREATE INDEX IDX_FBD8E0F898680F6C ON job (job_scholastic_duration_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 FOREIGN KEY FK_FBD8E0F898680F6C');
$this->addSql('DROP TABLE job_scholastic_duration');
$this->addSql('DROP INDEX IDX_FBD8E0F898680F6C ON job');
$this->addSql('ALTER TABLE job ADD scholastic_duration VARCHAR(255) DEFAULT NULL, DROP job_scholastic_duration_id');
}
}