vendor/bluue/sales-bundle/migrations/Version20230117091344.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace SalesBundleMigrations;
  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 Version20230117091344 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->addSql('ALTER TABLE sales_bundle__order_line ADD canceled_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD canceled_at DATETIME DEFAULT NULL');
  14.         $this->addSql('ALTER TABLE sales_bundle__order_line ADD CONSTRAINT FK_38D3FC511418957 FOREIGN KEY (canceled_by_id) REFERENCES user (id)');
  15.         $this->addSql('CREATE INDEX IDX_38D3FC511418957 ON sales_bundle__order_line (canceled_by_id)');
  16.         $this->addSql('CREATE INDEX canceled_at ON sales_bundle__order_line (canceled_at)');
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.         $this->addSql('ALTER TABLE sales_bundle__order_line DROP FOREIGN KEY FK_38D3FC511418957');
  21.         $this->addSql('DROP INDEX IDX_38D3FC511418957 ON sales_bundle__order_line');
  22.         $this->addSql('DROP INDEX canceled_at ON sales_bundle__order_line');
  23.         $this->addSql('ALTER TABLE sales_bundle__order_line DROP canceled_by_id, DROP canceled_at');
  24.     }
  25. }