<?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 Version20250401074303 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 user_file_transport (id INT AUTO_INCREMENT NOT NULL, mean_of_transport VARCHAR(255) NOT NULL, average_km INT DEFAULT NULL, fuel VARCHAR(255) DEFAULT NULL, fiscal_horse_power INT DEFAULT NULL, discr VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_file_transport_owner (id INT NOT NULL, user_file_id INT NOT NULL, INDEX IDX_106AC53ECBC66766 (user_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_file_transport_spouse (id INT NOT NULL, user_file_id INT NOT NULL, INDEX IDX_551EE690CBC66766 (user_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user_file_transport_owner ADD CONSTRAINT FK_106AC53ECBC66766 FOREIGN KEY (user_file_id) REFERENCES user_file (id)');
$this->addSql('ALTER TABLE user_file_transport_owner ADD CONSTRAINT FK_106AC53EBF396750 FOREIGN KEY (id) REFERENCES user_file_transport (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_file_transport_spouse ADD CONSTRAINT FK_551EE690CBC66766 FOREIGN KEY (user_file_id) REFERENCES user_file (id)');
$this->addSql('ALTER TABLE user_file_transport_spouse ADD CONSTRAINT FK_551EE690BF396750 FOREIGN KEY (id) REFERENCES user_file_transport (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_file_transport_owner DROP FOREIGN KEY FK_106AC53EBF396750');
$this->addSql('ALTER TABLE user_file_transport_spouse DROP FOREIGN KEY FK_551EE690BF396750');
$this->addSql('DROP TABLE user_file_transport');
$this->addSql('DROP TABLE user_file_transport_owner');
$this->addSql('DROP TABLE user_file_transport_spouse');
}
}