<?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 Version20260429085410 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 tache_vehicule (taches_id INT NOT NULL, vehicule_id BIGINT NOT NULL, PRIMARY KEY(taches_id, vehicule_id))');
$this->addSql('CREATE INDEX IDX_92EEEE20B8A61670 ON tache_vehicule (taches_id)');
$this->addSql('CREATE INDEX IDX_92EEEE204A4A3511 ON tache_vehicule (vehicule_id)');
$this->addSql('ALTER TABLE tache_vehicule ADD CONSTRAINT FK_92EEEE20B8A61670 FOREIGN KEY (taches_id) REFERENCES taches (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE tache_vehicule ADD CONSTRAINT FK_92EEEE204A4A3511 FOREIGN KEY (vehicule_id) REFERENCES vehicule (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE vehicule ADD type_energie VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE vehicule ALTER puissance_fiscale DROP NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER date_achat DROP NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER date_mise_service DROP NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER numero_carte_grise DROP NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER documents_carte_grise DROP NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER numero_contrat_assurance DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE tache_vehicule DROP CONSTRAINT FK_92EEEE20B8A61670');
$this->addSql('ALTER TABLE tache_vehicule DROP CONSTRAINT FK_92EEEE204A4A3511');
$this->addSql('DROP TABLE tache_vehicule');
$this->addSql('ALTER TABLE vehicule DROP type_energie');
$this->addSql('ALTER TABLE vehicule ALTER puissance_fiscale SET NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER date_achat SET NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER date_mise_service SET NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER numero_carte_grise SET NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER documents_carte_grise SET NOT NULL');
$this->addSql('ALTER TABLE vehicule ALTER numero_contrat_assurance SET NOT NULL');
}
}