<?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 Version20211020080359 extends AbstractMigration
{
public function getDescription(): string
{
return 'Added company id into demand_file table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE demand_file ADD company_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE demand_file ADD CONSTRAINT FK_525D9656979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('CREATE INDEX IDX_525D9656979B1AD6 ON demand_file (company_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE demand_file DROP FOREIGN KEY FK_525D9656979B1AD6');
$this->addSql('DROP INDEX IDX_525D9656979B1AD6 ON demand_file');
$this->addSql('ALTER TABLE demand_file DROP company_id');
}
}