<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220828141228 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A441AB247 FOREIGN KEY (filter_model_id) REFERENCES truck_filter_model (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30AD5F9F472 FOREIGN KEY (filter_traction_id) REFERENCES truck_filter_traction (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A72DCFBF6 FOREIGN KEY (filter_type_id) REFERENCES truck_filter_type (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A9620C624 FOREIGN KEY (filter_power_id) REFERENCES truck_filter_power (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE truck ADD CONSTRAINT FK_CDCCF30A22359F68 FOREIGN KEY (filter_tonnage_id) REFERENCES truck_filter_tonnage (id) ON DELETE SET NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A441AB247');
$this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30AD5F9F472');
$this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A72DCFBF6');
$this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A9620C624');
$this->addSql('ALTER TABLE truck DROP FOREIGN KEY FK_CDCCF30A22359F68');
$this->addSql('DROP TABLE truck');
}
}