<?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 Version20240925150257 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 theme_plateau (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE categorie ADD display TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE produit ADD theme_id INT DEFAULT NULL, ADD nb_personne INT DEFAULT NULL');
$this->addSql('ALTER TABLE produit ADD CONSTRAINT FK_29A5EC2759027487 FOREIGN KEY (theme_id) REFERENCES theme_plateau (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_29A5EC2759027487 ON produit (theme_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE produit DROP FOREIGN KEY FK_29A5EC2759027487');
$this->addSql('DROP TABLE theme_plateau');
$this->addSql('ALTER TABLE categorie DROP display');
$this->addSql('DROP INDEX IDX_29A5EC2759027487 ON produit');
$this->addSql('ALTER TABLE produit DROP theme_id, DROP nb_personne');
}
}