migrations/Version20231226102430.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 Version20231226102430 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 history_send ADD order_item_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE history_send ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE history_send ADD send_type VARCHAR(50) DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE history_send ADD external_id VARCHAR(50) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE history_send ADD service_status VARCHAR(50) DEFAULT NULL');
  23.         $this->addSql('COMMENT ON COLUMN history_send.updated_at IS \'(DC2Type:datetime_immutable)\'');
  24.         $this->addSql('ALTER TABLE history_send ADD CONSTRAINT FK_AC464AB1E415FB15 FOREIGN KEY (order_item_id) REFERENCES order_item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  25.         $this->addSql('CREATE INDEX IDX_AC464AB1E415FB15 ON history_send (order_item_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('CREATE SCHEMA public');
  31.         $this->addSql('ALTER TABLE history_send DROP CONSTRAINT FK_AC464AB1E415FB15');
  32.         $this->addSql('DROP INDEX IDX_AC464AB1E415FB15');
  33.         $this->addSql('ALTER TABLE history_send DROP order_item_id');
  34.         $this->addSql('ALTER TABLE history_send DROP updated_at');
  35.         $this->addSql('ALTER TABLE history_send DROP send_type');
  36.         $this->addSql('ALTER TABLE history_send DROP external_id');
  37.         $this->addSql('ALTER TABLE history_send DROP service_status');
  38.     }
  39. }