migrations/Version20250411141952.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 Version20250411141952 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('ALTER TABLE cart_has_product_price ADD shipping_time_id INT DEFAULT NULL');
  19. $this->addSql('ALTER TABLE cart_has_product_price ADD CONSTRAINT FK_D90A9B5CB8A2DBFF FOREIGN KEY (shipping_time_id) REFERENCES shipping_time (id)');
  20. $this->addSql('CREATE INDEX IDX_D90A9B5CB8A2DBFF ON cart_has_product_price (shipping_time_id)');
  21. $this->addSql('ALTER TABLE `order` ADD parent_id INT DEFAULT NULL, ADD shipping_time_id INT DEFAULT NULL');
  22. $this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F5299398727ACA70 FOREIGN KEY (parent_id) REFERENCES `order` (id)');
  23. $this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F5299398B8A2DBFF FOREIGN KEY (shipping_time_id) REFERENCES shipping_time (id)');
  24. $this->addSql('CREATE INDEX IDX_F5299398727ACA70 ON `order` (parent_id)');
  25. $this->addSql('CREATE INDEX IDX_F5299398B8A2DBFF ON `order` (shipping_time_id)');
  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 `order` DROP FOREIGN KEY FK_F5299398727ACA70');
  31. $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398B8A2DBFF');
  32. $this->addSql('DROP INDEX IDX_F5299398727ACA70 ON `order`');
  33. $this->addSql('DROP INDEX IDX_F5299398B8A2DBFF ON `order`');
  34. $this->addSql('ALTER TABLE `order` DROP parent_id, DROP shipping_time_id');
  35. $this->addSql('ALTER TABLE cart_has_product_price DROP FOREIGN KEY FK_D90A9B5CB8A2DBFF');
  36. $this->addSql('DROP INDEX IDX_D90A9B5CB8A2DBFF ON cart_has_product_price');
  37. $this->addSql('ALTER TABLE cart_has_product_price DROP shipping_time_id');
  38. }
  39. }