migrations/Version20201227195312.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 Version20201227195312 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema): void
  12.     {
  13.         $this->addSql('CREATE TABLE lot (
  14.             id INT AUTO_INCREMENT NOT NULL,
  15.             auction_id INT DEFAULT NULL,
  16.             dealer_id INT DEFAULT NULL,
  17.             customer_id INT DEFAULT NULL,
  18.             number INT DEFAULT NULL,
  19.             lot_id VARCHAR(255) NOT NULL,
  20.             status INT DEFAULT NULL,
  21.             name VARCHAR(255) NOT NULL,
  22.             starting_price INT DEFAULT NULL,
  23.             reserve INT DEFAULT NULL,
  24.             sold INT DEFAULT NULL,
  25.             est_low INT DEFAULT NULL,
  26.             est_high INT DEFAULT NULL,
  27.             description LONGTEXT NOT NULL,
  28.             provenance LONGTEXT DEFAULT NULL,
  29.             literature LONGTEXT DEFAULT NULL,
  30.             exhibited VARCHAR(255) DEFAULT NULL,
  31.             lot_condition VARCHAR(255) DEFAULT NULL,
  32.             country VARCHAR(255) NOT NULL,
  33.             year INT DEFAULT NULL,
  34.             nominal VARCHAR(255) DEFAULT NULL,
  35.             currency VARCHAR(255) DEFAULT NULL,
  36.             placeholder1 VARCHAR(255) DEFAULT NULL,
  37.             placeholder2 VARCHAR(255) DEFAULT NULL,
  38.             placeholder3 VARCHAR(255) DEFAULT NULL,
  39.             INDEX IDX_B81291B57B8F0DE (auction_id),
  40.             INDEX IDX_B81291B249E6EA1 (dealer_id),
  41.             INDEX IDX_B81291B9395C3F3 (customer_id),
  42.             PRIMARY KEY(id)
  43.         ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  44.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B57B8F0DE FOREIGN KEY (auction_id) REFERENCES auction (id)');
  45.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B249E6EA1 FOREIGN KEY (dealer_id) REFERENCES dealer (id)');
  46.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291B9395C3F3 FOREIGN KEY (customer_id) REFERENCES client (id)');
  47.     }
  48.     public function down(Schema $schema): void
  49.     {
  50.         $this->addSql('DROP TABLE lot');
  51.     }
  52. }