migrations/Version20230807202055.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. final class Version20230807202055 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE lot_move ADD user_id INT DEFAULT NULL');
  11.         $this->addSql('ALTER TABLE lot_move ADD CONSTRAINT FK_7B12A938A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  12.         $this->addSql('CREATE INDEX IDX_7B12A938A76ED395 ON lot_move (user_id)');
  13.     }
  14.     public function down(Schema $schema): void
  15.     {
  16.         $this->addSql('ALTER TABLE lot_move DROP FOREIGN KEY FK_7B12A938A76ED395');
  17.         $this->addSql('DROP INDEX IDX_7B12A938A76ED395 ON lot_move');
  18.         $this->addSql('ALTER TABLE lot_move DROP user_id');
  19.     }
  20. }