<?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 Version20250723101101 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(<<<'SQL'
CREATE TABLE collissage_demande_prestation (id INT AUTO_INCREMENT NOT NULL, demande_prestation_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, typeConditionnement ENUM('Colis', 'Palette') NOT NULL COMMENT '(DC2Type:ConditionnementType)', poids INT DEFAULT NULL, longueur INT DEFAULT NULL, largeur INT DEFAULT NULL, hauteur INT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)', INDEX IDX_5E67E1882EC294E4 (demande_prestation_id), INDEX IDX_5E67E188B03A8386 (created_by_id), INDEX IDX_5E67E188896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation ADD CONSTRAINT FK_5E67E1882EC294E4 FOREIGN KEY (demande_prestation_id) REFERENCES demande_prestation (id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation ADD CONSTRAINT FK_5E67E188B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation ADD CONSTRAINT FK_5E67E188896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation DROP FOREIGN KEY FK_5E67E1882EC294E4
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation DROP FOREIGN KEY FK_5E67E188B03A8386
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE collissage_demande_prestation DROP FOREIGN KEY FK_5E67E188896DBBDE
SQL);
$this->addSql(<<<'SQL'
DROP TABLE collissage_demande_prestation
SQL);
}
}