<?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 Version20251020130859 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 sale ADD employee_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE sale ADD CONSTRAINT FK_E54BC0058C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id)');
$this->addSql('CREATE INDEX IDX_E54BC0058C03F15C ON sale (employee_id)');
$this->addSql('ALTER TABLE sale_detail ADD collection_id INT DEFAULT NULL, ADD emotion_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE sale_detail ADD CONSTRAINT FK_5A677151514956FD FOREIGN KEY (collection_id) REFERENCES collection (id)');
$this->addSql('ALTER TABLE sale_detail ADD CONSTRAINT FK_5A6771511EE4A582 FOREIGN KEY (emotion_id) REFERENCES emotion (id)');
$this->addSql('CREATE INDEX IDX_5A677151514956FD ON sale_detail (collection_id)');
$this->addSql('CREATE INDEX IDX_5A6771511EE4A582 ON sale_detail (emotion_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sale DROP FOREIGN KEY FK_E54BC0058C03F15C');
$this->addSql('DROP INDEX IDX_E54BC0058C03F15C ON sale');
$this->addSql('ALTER TABLE sale DROP employee_id');
$this->addSql('ALTER TABLE sale_detail DROP FOREIGN KEY FK_5A677151514956FD');
$this->addSql('ALTER TABLE sale_detail DROP FOREIGN KEY FK_5A6771511EE4A582');
$this->addSql('DROP INDEX IDX_5A677151514956FD ON sale_detail');
$this->addSql('DROP INDEX IDX_5A6771511EE4A582 ON sale_detail');
$this->addSql('ALTER TABLE sale_detail DROP collection_id, DROP emotion_id');
}
}