<?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 Version20241011092411 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 work_order ADD partner_from_id INT DEFAULT NULL, ADD type INT DEFAULT 1 NOT NULL');
$this->addSql('ALTER TABLE work_order ADD CONSTRAINT FK_DDD2E8B7BF24BA16 FOREIGN KEY (partner_from_id) REFERENCES partners (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_DDD2E8B7BF24BA16 ON work_order (partner_from_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE work_order DROP FOREIGN KEY FK_DDD2E8B7BF24BA16');
$this->addSql('DROP INDEX IDX_DDD2E8B7BF24BA16 ON work_order');
$this->addSql('ALTER TABLE work_order DROP partner_from_id, DROP type');
}
}