migrations/Version20220829042521.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220829042521 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('DROP INDEX UNIQ_8D93D6495490BE13 ON user');
  19.         $this->addSql('CREATE UNIQUE INDEX employee_no_unique ON user (employee_no, delete_date)');
  20.         $this->addSql('ALTER TABLE orders_material DROP FOREIGN KEY FK_BB98A853B3C719BE');
  21.         $this->addSql('DROP INDEX IDX_BB98A853B3C719BE ON orders_material');
  22.         $this->addSql('ALTER TABLE orders_material CHANGE ordersDetail_id orders_detail_id INT DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE orders_material ADD CONSTRAINT FK_BB98A853AA1042E3 FOREIGN KEY (orders_detail_id) REFERENCES orders_detail (id)');
  24.         $this->addSql('CREATE INDEX IDX_BB98A853AA1042E3 ON orders_material (orders_detail_id)');
  25.         $this->addSql('ALTER TABLE supply RENAME INDEX idx_d219948ccdf7c0c5 TO IDX_D219948C90B178F5');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('ALTER TABLE orders_material DROP FOREIGN KEY FK_BB98A853AA1042E3');
  31.         $this->addSql('DROP INDEX IDX_BB98A853AA1042E3 ON orders_material');
  32.         $this->addSql('ALTER TABLE orders_material CHANGE orders_detail_id ordersDetail_id INT DEFAULT NULL');
  33.         $this->addSql('ALTER TABLE orders_material ADD CONSTRAINT FK_BB98A853B3C719BE FOREIGN KEY (ordersDetail_id) REFERENCES orders_detail (id)');
  34.         $this->addSql('CREATE INDEX IDX_BB98A853B3C719BE ON orders_material (ordersDetail_id)');
  35.         $this->addSql('ALTER TABLE supply RENAME INDEX idx_d219948c90b178f5 TO IDX_D219948CCDF7C0C5');
  36.         $this->addSql('DROP INDEX employee_no_unique ON User');
  37.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6495490BE13 ON User (employee_no)');
  38.     }
  39. }