app/DoctrineMigrations/Version20250908140438.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 Version20250908140438 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Add address_type field to dtb_order and dtb_shipping tables';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // Add address_type field to dtb_order table
  18.         $this->addSql('ALTER TABLE dtb_order ADD address_type INT DEFAULT 0 NOT NULL COMMENT \'Address type: 0=domestic, 1=overseas\'');
  19.         
  20.         // Add address_type field to dtb_shipping table
  21.         $this->addSql('ALTER TABLE dtb_shipping ADD address_type INT DEFAULT 0 NOT NULL COMMENT \'Address type: 0=domestic, 1=overseas\'');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // Remove address_type field from dtb_shipping table
  26.         $this->addSql('ALTER TABLE dtb_shipping DROP address_type');
  27.         
  28.         // Remove address_type field from dtb_order table
  29.         $this->addSql('ALTER TABLE dtb_order DROP address_type');
  30.     }
  31. }