migrations/Version20230620091758.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 Version20230620091758 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         // this up() migration is auto-generated, please modify it to your needs
  14.         $this->addSql('ALTER TABLE support_chat ADD order_id INT DEFAULT NULL');
  15.         $this->addSql('ALTER TABLE support_chat ADD CONSTRAINT FK_BD8B64F98D9F6D38 FOREIGN KEY (order_id) REFERENCES orders (id)');
  16.         $this->addSql('CREATE INDEX IDX_BD8B64F98D9F6D38 ON support_chat (order_id)');
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.         // this down() migration is auto-generated, please modify it to your needs
  21.         $this->addSql('ALTER TABLE support_chat DROP FOREIGN KEY FK_BD8B64F98D9F6D38');
  22.         $this->addSql('DROP INDEX IDX_BD8B64F98D9F6D38 ON support_chat');
  23.         $this->addSql('ALTER TABLE support_chat DROP order_id');
  24.     }
  25. }