<?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 Version20220311092933 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adding link between specialist and workshop - bitrix 19631';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE workshop ADD specialist_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE workshop ADD CONSTRAINT FK_9B6F02C47B100C1A FOREIGN KEY (specialist_id) REFERENCES specialist (id)');
$this->addSql('CREATE INDEX IDX_9B6F02C47B100C1A ON workshop (specialist_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE workshop DROP FOREIGN KEY FK_9B6F02C47B100C1A');
$this->addSql('DROP INDEX IDX_9B6F02C47B100C1A ON workshop');
$this->addSql('ALTER TABLE workshop DROP specialist_id');
}
}