<?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 Version20240416102928 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('ALTER TABLE commande_produits MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE commande_produits DROP PRIMARY KEY');
$this->addSql('ALTER TABLE commande_produits DROP id');
$this->addSql('ALTER TABLE commande_produits ADD PRIMARY KEY (id_commande_id, id_produit_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE commande_produits ADD id INT AUTO_INCREMENT NOT NULL, DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
}
}