<?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 Version20231108160653 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 dealoblige (id INT AUTO_INCREMENT NOT NULL, oblige_id INT DEFAULT NULL, dealinstallateur_id INT DEFAULT NULL, nom VARCHAR(255) NOT NULL, datedebut DATE DEFAULT NULL, datefin DATE DEFAULT NULL, INDEX IDX_46E7C7222A1A3550 (oblige_id), INDEX IDX_46E7C722B7081928 (dealinstallateur_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE dealoblige ADD CONSTRAINT FK_46E7C7222A1A3550 FOREIGN KEY (oblige_id) REFERENCES obliges (id)');
$this->addSql('ALTER TABLE dealoblige ADD CONSTRAINT FK_46E7C722B7081928 FOREIGN KEY (dealinstallateur_id) REFERENCES deal (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE dealoblige DROP FOREIGN KEY FK_46E7C7222A1A3550');
$this->addSql('ALTER TABLE dealoblige DROP FOREIGN KEY FK_46E7C722B7081928');
$this->addSql('DROP TABLE dealoblige');
}
}