<?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 Version20220829042521 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('DROP INDEX UNIQ_8D93D6495490BE13 ON user');
$this->addSql('CREATE UNIQUE INDEX employee_no_unique ON user (employee_no, delete_date)');
$this->addSql('ALTER TABLE orders_material DROP FOREIGN KEY FK_BB98A853B3C719BE');
$this->addSql('DROP INDEX IDX_BB98A853B3C719BE ON orders_material');
$this->addSql('ALTER TABLE orders_material CHANGE ordersDetail_id orders_detail_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE orders_material ADD CONSTRAINT FK_BB98A853AA1042E3 FOREIGN KEY (orders_detail_id) REFERENCES orders_detail (id)');
$this->addSql('CREATE INDEX IDX_BB98A853AA1042E3 ON orders_material (orders_detail_id)');
$this->addSql('ALTER TABLE supply RENAME INDEX idx_d219948ccdf7c0c5 TO IDX_D219948C90B178F5');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE orders_material DROP FOREIGN KEY FK_BB98A853AA1042E3');
$this->addSql('DROP INDEX IDX_BB98A853AA1042E3 ON orders_material');
$this->addSql('ALTER TABLE orders_material CHANGE orders_detail_id ordersDetail_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE orders_material ADD CONSTRAINT FK_BB98A853B3C719BE FOREIGN KEY (ordersDetail_id) REFERENCES orders_detail (id)');
$this->addSql('CREATE INDEX IDX_BB98A853B3C719BE ON orders_material (ordersDetail_id)');
$this->addSql('ALTER TABLE supply RENAME INDEX idx_d219948c90b178f5 TO IDX_D219948CCDF7C0C5');
$this->addSql('DROP INDEX employee_no_unique ON User');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6495490BE13 ON User (employee_no)');
}
}