<?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 Version20260401114343 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 custom_extra (id INT AUTO_INCREMENT NOT NULL, reservation_id INT DEFAULT NULL, privatisation_id INT DEFAULT NULL, token_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, price INT NOT NULL, quantity INT NOT NULL, tva_ratio DOUBLE PRECISION DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_8E32F50CB83297E7 (reservation_id), INDEX IDX_8E32F50CCE4BE7FC (privatisation_id), INDEX IDX_8E32F50C41DEE7B9 (token_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE custom_extra ADD CONSTRAINT FK_8E32F50CB83297E7 FOREIGN KEY (reservation_id) REFERENCES reservation (id)');
$this->addSql('ALTER TABLE custom_extra ADD CONSTRAINT FK_8E32F50CCE4BE7FC FOREIGN KEY (privatisation_id) REFERENCES privatisation (id)');
$this->addSql('ALTER TABLE custom_extra ADD CONSTRAINT FK_8E32F50C41DEE7B9 FOREIGN KEY (token_id) REFERENCES token (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE custom_extra DROP FOREIGN KEY FK_8E32F50CB83297E7');
$this->addSql('ALTER TABLE custom_extra DROP FOREIGN KEY FK_8E32F50CCE4BE7FC');
$this->addSql('ALTER TABLE custom_extra DROP FOREIGN KEY FK_8E32F50C41DEE7B9');
$this->addSql('DROP TABLE custom_extra');
}
}