migrations/Version20230731220648.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 Version20230731220648 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('CREATE TABLE lot_move (id INT AUTO_INCREMENT NOT NULL, auction_from_id INT DEFAULT NULL, auction_to_id INT DEFAULT NULL, lot_id INT DEFAULT NULL, created DATETIME NOT NULL, INDEX IDX_7B12A93820DF06B6 (auction_from_id), INDEX IDX_7B12A9387F21D36C (auction_to_id), INDEX IDX_7B12A938A8CBA5F7 (lot_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  11.         $this->addSql('ALTER TABLE lot_move ADD CONSTRAINT FK_7B12A93820DF06B6 FOREIGN KEY (auction_from_id) REFERENCES auction (id)');
  12.         $this->addSql('ALTER TABLE lot_move ADD CONSTRAINT FK_7B12A9387F21D36C FOREIGN KEY (auction_to_id) REFERENCES auction (id)');
  13.         $this->addSql('ALTER TABLE lot_move ADD CONSTRAINT FK_7B12A938A8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id)');
  14.     }
  15.     public function down(Schema $schema): void
  16.     {
  17.         $this->addSql('DROP TABLE lot_move');
  18.     }
  19. }