vendor/bluue/suppliers-orders-bundle/migrations/Version20230216133354.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace SuppliersOrdersBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20230216133354 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD delivery_country_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_country_state_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_city VARCHAR(128) DEFAULT NULL, ADD delivery_postcode VARCHAR(32) DEFAULT NULL, ADD delivery_address VARCHAR(255) DEFAULT NULL, ADD delivery_address2 VARCHAR(255) DEFAULT NULL');
  11.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD CONSTRAINT FK_E63ACA81E76AA954 FOREIGN KEY (delivery_country_id) REFERENCES country (id)');
  12.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order ADD CONSTRAINT FK_E63ACA81737BF729 FOREIGN KEY (delivery_country_state_id) REFERENCES country_state (id)');
  13.         $this->addSql('CREATE INDEX IDX_E63ACA81E76AA954 ON suppliers_orders_bundle__supplier_order (delivery_country_id)');
  14.         $this->addSql('CREATE INDEX IDX_E63ACA81737BF729 ON suppliers_orders_bundle__supplier_order (delivery_country_state_id)');
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP FOREIGN KEY FK_E63ACA81E76AA954');
  19.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP FOREIGN KEY FK_E63ACA81737BF729');
  20.         $this->addSql('DROP INDEX IDX_E63ACA81E76AA954 ON suppliers_orders_bundle__supplier_order');
  21.         $this->addSql('DROP INDEX IDX_E63ACA81737BF729 ON suppliers_orders_bundle__supplier_order');
  22.         $this->addSql('ALTER TABLE suppliers_orders_bundle__supplier_order DROP delivery_country_id, DROP delivery_country_state_id, DROP delivery_city, DROP delivery_postcode, DROP delivery_address, DROP delivery_address2');
  23.     }
  24. }