migrations/Version20220828141228.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 Version20220828141228 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('CREATE TABLE truck (id INT AUTO_INCREMENT NOT NULL, filter_model_id INT DEFAULT NULL, filter_traction_id INT DEFAULT NULL, filter_type_id INT DEFAULT NULL, filter_power_id INT DEFAULT NULL, filter_tonnage_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, image JSON NOT NULL, gallery_items JSON NOT NULL, characteristics_show TINYINT(1) DEFAULT 1 NOT NULL, characteristics_items JSON NOT NULL, description_show TINYINT(1) DEFAULT 1 NOT NULL, description_title VARCHAR(255) DEFAULT NULL, description_text LONGTEXT DEFAULT NULL, applications_show TINYINT(1) DEFAULT 1 NOT NULL, applications_text LONGTEXT DEFAULT NULL, applications_items JSON NOT NULL, attributes_show TINYINT(1) DEFAULT 1 NOT NULL, attributes_items JSON NOT NULL, technical_datasheet_show TINYINT(1) DEFAULT 1 NOT NULL, technical_datasheet_items JSON NOT NULL, technical_datasheet_file JSON NOT NULL, additional_show TINYINT(1) DEFAULT 0 NOT NULL, additional_title VARCHAR(255) DEFAULT NULL, additional_items JSON NOT NULL, active TINYINT(1) DEFAULT 1, in_home TINYINT(1) DEFAULT 1, position INT NOT NULL, slug VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT NULL, modified_at DATETIME DEFAULT NULL, created_user INT DEFAULT NULL, modified_user INT DEFAULT NULL, UNIQUE INDEX UNIQ_CDCCF30A989D9B62 (slug), INDEX IDX_CDCCF30A441AB247 (filter_model_id), INDEX IDX_CDCCF30AD5F9F472 (filter_traction_id), INDEX IDX_CDCCF30A72DCFBF6 (filter_type_id), INDEX IDX_CDCCF30A9620C624 (filter_power_id), INDEX IDX_CDCCF30A22359F68 (filter_tonnage_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A441AB247 FOREIGN KEY (filter_model_id) REFERENCES truck_filter_model (id) ON DELETE SET NULL');
  20.         $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30AD5F9F472 FOREIGN KEY (filter_traction_id) REFERENCES truck_filter_traction (id) ON DELETE SET NULL');
  21.         $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A72DCFBF6 FOREIGN KEY (filter_type_id) REFERENCES truck_filter_type (id) ON DELETE SET NULL');
  22.         $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A9620C624 FOREIGN KEY (filter_power_id) REFERENCES truck_filter_power (id) ON DELETE SET NULL');
  23.         $this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A22359F68 FOREIGN KEY (filter_tonnage_id) REFERENCES truck_filter_tonnage (id) ON DELETE SET NULL');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A441AB247');
  29.         $this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30AD5F9F472');
  30.         $this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A72DCFBF6');
  31.         $this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A9620C624');
  32.         $this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A22359F68');
  33.         $this->addSql('DROP TABLE truck');
  34.     }
  35. }